diff options
Diffstat (limited to 'ext/pcre/php_pcre.c')
| -rw-r--r-- | ext/pcre/php_pcre.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index ea539803e1..a0846214ba 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1128,7 +1128,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 = NULL; + zval callback_name; int replace_count=0; int *replace_count_ptr=NULL; @@ -1147,13 +1147,13 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl convert_to_string_ex(replace); if (is_callable_replace) { if (!zend_is_callable(*replace, 0, &callback_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "requires argument 2, '%s', to be a valid callback", callback_name); - efree(callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "requires argument 2, '%R', to be a valid callback", Z_TYPE(callback_name), Z_UNIVAL(callback_name)); + zval_dtor(&callback_name); *return_value = **subject; zval_copy_ctor(return_value); return; } - efree(callback_name); + zval_dtor(&callback_name); } SEPARATE_ZVAL(regex); |
