Merge branch 'PHP-7.2'

* PHP-7.2:
  Fix bug #76524 - ZipArchive memory leak
This commit is contained in:
Anatol Belski 2018-07-10 11:20:50 +02:00
commit d82cb24e19
2 changed files with 26 additions and 2 deletions

View file

@ -1029,10 +1029,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) {