From: Wez Furlong Date: Sat, 12 May 2001 00:45:55 +0000 (+0000) Subject: Fixed leak. X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~473 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=340c56e5c7aebbb41a4d8c37fa7a45100090d5c4;p=php Fixed leak. --- diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 9289adc035..4344591cd6 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -970,7 +970,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl int limit_val = -1; char *string_key; ulong num_key; - char *callback_name; + char *callback_name = NULL; /* Get function parameters and do error-checking. */ if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 4 || @@ -989,6 +989,8 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl zval_copy_ctor(return_value); return; } + if (callback_name) + efree(callback_name); SEPARATE_ZVAL(regex); SEPARATE_ZVAL(subject);