From: Xinchen Hui Date: Thu, 23 Jun 2016 06:06:48 +0000 (+0800) Subject: Fixed bug #72476 (Memleak in jit_stack) X-Git-Tag: php-7.0.9RC1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd74e7d0133493ee4290857ac368f5fbdd278084;p=php Fixed bug #72476 (Memleak in jit_stack) --- diff --git a/NEWS b/NEWS index 7cae9b824b..4fd07fdcef 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 356b5dc95a..3d59b77005 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); }