summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2018-07-10 11:19:54 +0200
committerAnatol Belski <ab@php.net>2018-07-10 11:19:54 +0200
commitebb590b625efb443e43bad8b0cfd915bc20c380e (patch)
tree9b39b92c82fd2c57f4ffb1bfd0cd132d5a8a9d77 /ext/zip/php_zip.c
parent474292c3e4ed3f1c613dad51c13f61fe23eb6501 (diff)
parent08f08858f3bc62fac9150ca5b669df060b5af5a5 (diff)
downloadphp-git-ebb590b625efb443e43bad8b0cfd915bc20c380e.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix bug #76524 - ZipArchive memory leak
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 6444853b8b..d83272f564 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1026,10 +1026,13 @@ static void php_zip_object_free_storage(zend_object *object) /* {{{ */
}
if (intern->za) {
if (zip_close(intern->za) != 0) {
+#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
+ php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", "zip_close have failed");
+#else
php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", zip_strerror(intern->za));
- return;
+ zip_discard(intern->za);
+#endif
}
- intern->za = NULL;
}
if (intern->buffers_cnt>0) {