summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2017-11-20 08:50:51 +0100
committerRemi Collet <remi@php.net>2017-11-20 08:50:51 +0100
commit0c54397879ecae1e9f13115c72fa92a454cf82c1 (patch)
treee2ae76680f4e980167efe1089c9dab8ee0495c5c /ext/zip/php_zip.c
parent092d0922ea9779f93962370191dd2a9522c27032 (diff)
parent8832c46607cd9e9a143d954a10dfec2b61295bbb (diff)
downloadphp-git-0c54397879ecae1e9f13115c72fa92a454cf82c1.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: 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 28527cbee1..0cebe14d99 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1514,7 +1514,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);