From 4a475a4976db92e71949786cdf5990c61514261e Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 4 Jul 2018 19:22:24 +0300 Subject: Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors. zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places. Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors. --- ext/zip/php_zip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/zip/php_zip.c') diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index d355ca3425..24dd0020d6 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -896,7 +896,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, } if (member == &tmp_member) { - zval_dtor(member); + zval_ptr_dtor_str(&tmp_member); } return retval; @@ -932,7 +932,7 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void ** } if (member == &tmp_member) { - zval_dtor(member); + zval_ptr_dtor_str(&tmp_member); } return retval; @@ -977,7 +977,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac } if (member == &tmp_member) { - zval_dtor(member); + zval_ptr_dtor_str(&tmp_member); } return retval; @@ -1743,7 +1743,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* if ((add_path_len + file_stripped_len) > MAXPATHLEN) { php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %zd given)", MAXPATHLEN - 1, (add_path_len + file_stripped_len)); - zval_ptr_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } snprintf(entry_name_buf, MAXPATHLEN, "%s%s", add_path, file_stripped); @@ -1760,7 +1760,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* if (php_zip_add_file(intern, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), entry_name, entry_name_len, 0, 0) < 0) { - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } } -- cgit v1.2.1