diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index ed4ad2516f4..9a12aed01a1 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -697,12 +697,15 @@ PHP_METHOD(Phar, webPhar) rewrite_fci.retval = &retval; if (FAILURE == zend_call_function(&rewrite_fci, &rewrite_fcc)) { + zval_ptr_dtor_str(¶ms); if (!EG(exception)) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: failed to call rewrite callback"); } goto cleanup_fail; } + zval_ptr_dtor_str(¶ms); + switch (Z_TYPE(retval)) { case IS_STRING: efree(entry); @@ -723,7 +726,6 @@ PHP_METHOD(Phar, webPhar) zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false"); cleanup_fail: - zval_ptr_dtor(¶ms); if (free_pathinfo) { efree(path_info); }