]> granicus.if.org Git - php/commitdiff
Fixed leak.
authorWez Furlong <wez@php.net>
Sat, 12 May 2001 00:45:55 +0000 (00:45 +0000)
committerWez Furlong <wez@php.net>
Sat, 12 May 2001 00:45:55 +0000 (00:45 +0000)
ext/pcre/php_pcre.c

index 9289adc035234dbad3682e9bdc1ad98ba6a711dd..4344591cd65ff09aeba5feaf9227a7650f9e0e6c 100644 (file)
@@ -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);