]> granicus.if.org Git - php/commitdiff
Fixed bug #72476 (Memleak in jit_stack)
authorXinchen Hui <laruence@gmail.com>
Thu, 23 Jun 2016 06:06:48 +0000 (14:06 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 23 Jun 2016 06:06:48 +0000 (14:06 +0800)
NEWS
ext/pcre/php_pcre.c

diff --git a/NEWS b/NEWS
index 7cae9b824bdccc4d99a645d20be66768d2fd6bff..4fd07fdcefc19eaefa07937b130d17accb6d8947 100644 (file)
--- 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:
index 356b5dc95abf3f996332e6cc06247e6d9a10d2b8..3d59b77005d8569d07a01f798a93b1c0012c4e23 100644 (file)
@@ -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);
        }