summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 815f64ecb4..a98c8cc555 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -191,7 +191,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, size_t
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) {
efree(file_dirname_fullpath);
- zend_string_release(file_basename);
+ zend_string_release_ex(file_basename, 0);
CWD_STATE_FREE(new_state.cwd);
return 0;
}
@@ -203,7 +203,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, size_t
if (!ret) {
efree(file_dirname_fullpath);
if (!is_dir_only) {
- zend_string_release(file_basename);
+ zend_string_release_ex(file_basename, 0);
CWD_STATE_FREE(new_state.cwd);
}
return 0;
@@ -220,13 +220,13 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, size_t
len = spprintf(&fullpath, 0, "%s/%s", file_dirname_fullpath, ZSTR_VAL(file_basename));
if (!len) {
efree(file_dirname_fullpath);
- zend_string_release(file_basename);
+ zend_string_release_ex(file_basename, 0);
CWD_STATE_FREE(new_state.cwd);
return 0;
} else if (len > MAXPATHLEN) {
php_error_docref(NULL, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN);
efree(file_dirname_fullpath);
- zend_string_release(file_basename);
+ zend_string_release_ex(file_basename, 0);
CWD_STATE_FREE(new_state.cwd);
return 0;
}
@@ -238,7 +238,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, size_t
if (ZIP_OPENBASEDIR_CHECKPATH(fullpath)) {
efree(fullpath);
efree(file_dirname_fullpath);
- zend_string_release(file_basename);
+ zend_string_release_ex(file_basename, 0);
CWD_STATE_FREE(new_state.cwd);
return 0;
}
@@ -268,7 +268,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, size_t
done:
efree(fullpath);
- zend_string_release(file_basename);
+ zend_string_release_ex(file_basename, 0);
efree(file_dirname_fullpath);
CWD_STATE_FREE(new_state.cwd);
@@ -673,14 +673,14 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
if ((namelist_len == 1 && ZSTR_VAL(namelist[i])[0] == '.') ||
(namelist_len == 2 && ZSTR_VAL(namelist[i])[0] == '.' && ZSTR_VAL(namelist[i])[1] == '.')) {
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
continue;
}
if ((path_len + namelist_len + 1) >= MAXPATHLEN) {
php_error_docref(NULL, E_WARNING, "add_path string too long (max: %u, %zu given)",
MAXPATHLEN - 1, (path_len + namelist_len + 1));
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
break;
}
@@ -688,31 +688,31 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
if (0 != VCWD_STAT(fullpath, &s)) {
php_error_docref(NULL, E_WARNING, "Cannot read <%s>", fullpath);
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
continue;
}
if (S_IFDIR == (s.st_mode & S_IFMT)) {
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
continue;
}
match_data = php_pcre_create_match_data(capture_count, re);
if (!match_data) {
/* Allocation failed, but can proceed to the next pattern. */
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
continue;
}
rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(namelist[i]), ZSTR_LEN(namelist[i]), 0, preg_options, match_data, mctx);
php_pcre_free_match_data(match_data);
/* 0 means that the vector is too small to hold all the captured substring offsets */
if (rc < 0) {
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
continue;
}
add_next_index_string(return_value, fullpath);
- zend_string_release(namelist[i]);
+ zend_string_release_ex(namelist[i], 0);
}
efree(namelist);
}
@@ -820,7 +820,7 @@ static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, z
/* Register for reflection */
ZVAL_NULL(&tmp);
zend_declare_property_ex(zip_class_entry, str, &tmp, ZEND_ACC_PUBLIC, NULL);
- zend_string_release(str);
+ zend_string_release_ex(str, 1);
}
/* }}} */
@@ -1760,7 +1760,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
entry_name = entry_name_buf;
entry_name_len = strlen(entry_name);
if (basename) {
- zend_string_release(basename);
+ zend_string_release_ex(basename, 0);
basename = NULL;
}