summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2017-11-20 08:51:29 +0100
committerRemi Collet <remi@php.net>2017-11-20 08:51:29 +0100
commitfa427a86cc06d793bb29b07927d788c2fdddf751 (patch)
treece926f8123abbae3e0001e61b98d49275755c2aa /ext/zip/php_zip.c
parent31d9287d2b4bc30a5fc032a94cb3cec214aa715e (diff)
parent50a867eb07c1fa82e113837422d55c2341b53719 (diff)
downloadphp-git-fa427a86cc06d793bb29b07927d788c2fdddf751.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: NEWS NEWS fix bug #75540 Segfault with libzip 1.3.1
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 2353519be4..5ca90c3ee3 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1537,7 +1537,10 @@ static ZIPARCHIVE_METHOD(close)
if ((err = zip_close(intern))) {
php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern));
+#if LIBZIP_VERSION_MAJOR < 1 || (LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR < 3) || (LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO < 1)
+ /* Fix memory leak in libzip < 1.3.1 */
zip_discard(intern);
+#endif
}
efree(ze_obj->filename);