]> granicus.if.org Git - php/commitdiff
MFH fix bug #44214: crash with preg_replace_callback and global variables
authorScott MacVicar <scottmac@php.net>
Mon, 8 Jun 2009 21:52:08 +0000 (21:52 +0000)
committerScott MacVicar <scottmac@php.net>
Mon, 8 Jun 2009 21:52:08 +0000 (21:52 +0000)
ext/pcre/php_pcre.c

index bcf9c425fa41d6c36dcb3d47efef8a68ef8f63ab..d8cb0ee3da54123806a8560e3171d28006645ed8 100644 (file)
@@ -842,8 +842,8 @@ static int preg_do_repl_func(zval *function, char *subject, int *offsets, char *
                result_len = offsets[1] - offsets[0];
                *result = estrndup(&subject[offsets[0]], result_len);
        }
-       zval_dtor(subpats);
-       FREE_ZVAL(subpats);
+
+       zval_ptr_dtor(&subpats);
 
        return result_len;
 }