diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 5ca90c3ee3e..92a5c036b41 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1536,9 +1536,10 @@ static ZIPARCHIVE_METHOD(close) ze_obj = Z_ZIP_P(self); if ((err = zip_close(intern))) { +#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1 + php_error_docref(NULL, E_WARNING, "%s", "zip_close have failed"); +#else 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 }