summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-03-21 20:17:04 +0800
committerXinchen Hui <laruence@php.net>2015-03-21 20:17:04 +0800
commita4529cc0e51d81432d8786448bea8b5f137d2cc3 (patch)
tree6ac3014c41f23ded69065b36d22311a3aebf365e /ext/pcre/php_pcre.c
parent8aa76a5bdd1204a2ec0483d08ad9d0c66f1b3b42 (diff)
downloadphp-git-a4529cc0e51d81432d8786448bea8b5f137d2cc3.tar.gz
Fixed memleak
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 99ef02059f..06f6179884 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1518,14 +1518,15 @@ static PHP_FUNCTION(preg_replace_callback_array)
ZVAL_STR_COPY(&regex, str_idx);
} else {
php_error_docref(NULL, E_WARNING, "Delimiter must not be alphanumeric or backslash");
- zval_dtor(return_value);
+ zval_ptr_dtor(return_value);
RETURN_NULL();
}
if (!zend_is_callable(replace, 0, &callback_name)) {
php_error_docref(NULL, E_WARNING, "'%s' is not a valid callback", callback_name->val);
zend_string_release(callback_name);
- zval_dtor(return_value);
+ zval_ptr_dtor(&regex);
+ zval_ptr_dtor(return_value);
ZVAL_COPY(return_value, subject);
return;
}
@@ -1547,7 +1548,7 @@ static PHP_FUNCTION(preg_replace_callback_array)
ZVAL_COPY_VALUE(return_value, &zv);
if (UNEXPECTED(EG(exception))) {
- zval_dtor(return_value);
+ zval_ptr_dtor(return_value);
RETURN_NULL();
}
} ZEND_HASH_FOREACH_END();