summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-04 19:22:24 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-04 19:22:24 +0300
commit4a475a4976db92e71949786cdf5990c61514261e (patch)
tree6934c9e00200e6388256656b8fa71c97a1a3a158 /ext/zip/php_zip.c
parentd798fd491be77943fb751ad97d85475bf324192c (diff)
downloadphp-git-4a475a4976db92e71949786cdf5990c61514261e.tar.gz
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.
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c10
1 files changed, 5 insertions, 5 deletions
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;
}
}