Skip to content

Commit 340c56e

Browse files
committed
Fixed leak.
1 parent be3b514 commit 340c56e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/pcre/php_pcre.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
970970
int limit_val = -1;
971971
char *string_key;
972972
ulong num_key;
973-
char *callback_name;
973+
char *callback_name = NULL;
974974

975975
/* Get function parameters and do error-checking. */
976976
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
989989
zval_copy_ctor(return_value);
990990
return;
991991
}
992+
if (callback_name)
993+
efree(callback_name);
992994

993995
SEPARATE_ZVAL(regex);
994996
SEPARATE_ZVAL(subject);

0 commit comments

Comments
 (0)