com php-src: Fixed bug #72476 (Memleak in jit_stack): N EWS ext/pcre/php_pcre.c
| From: | Xinchen Hui | Date: | Thu, 23 Jun 2016 06:06:48 +0000 |
| Subject: | com php-src: Fixed bug #72476 (Memleak in jit_stack): N EWS ext/pcre/php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92618@lists.php.net to get a copy of this message | ||
Commit: bd74e7d0133493ee4290857ac368f5fbdd278084
Author: Xinchen Hui <laruence@gmail.com> Thu, 23 Jun 2016 14:06:48 +0800
Parents: f90c832cb26336ee779b750d95cc35e5aa79f578
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bd74e7d0133493ee4290857ac368f5fbdd278084
Log:
Fixed bug #72476 (Memleak in jit_stack)
Bugs:
https://bugs.php.net/72476
Changed paths:
M NEWS
M ext/pcre/php_pcre.c
Diff:
diff --git a/NEWS b/NEWS
index 7cae9b8..4fd07fd 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ PHP NEWS
. Fixed bug #72399 (Use-After-Free in MBString (search_re)). (Laruence)
- PCRE:
+ . Fixed bug #72476 (Memleak in jit_stack). (Laruence)
. Fixed bug #72463 (mail fails with invalid argument). (Anatol)
- Standard:
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 356b5dc..3d59b77 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -216,7 +216,7 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
/* {{{ PHP_RINIT_FUNCTION(pcre) */
static PHP_RINIT_FUNCTION(pcre)
{
- if (PCRE_G(jit)) {
+ if (PCRE_G(jit) && jit_stack == NULL) {
jit_stack = pcre_jit_stack_alloc(PCRE_JIT_STACK_MIN_SIZE,PCRE_JIT_STACK_MAX_SIZE);
}