]> granicus.if.org Git - php/commitdiff
proper fix
authorRemi Collet <remi@php.net>
Mon, 9 Mar 2020 08:29:34 +0000 (09:29 +0100)
committerRemi Collet <remi@php.net>
Mon, 9 Mar 2020 08:29:34 +0000 (09:29 +0100)
ext/zip/php_zip.c

index d8e1f285a917021f2dff1ab8abc883620654be89..a63bef6b7bf26da60f668f879e487d2523d840bc 100644 (file)
@@ -1506,8 +1506,6 @@ static ZIPARCHIVE_METHOD(close)
        if (err) {
 #if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
                php_error_docref(NULL, E_WARNING, "zip_close have failed");
-               ze_obj->err_zip = 0;
-               ze_obj->err_sys = 0;
 #else
                php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern));
                /* Save error for property reader */
@@ -1525,6 +1523,9 @@ static ZIPARCHIVE_METHOD(close)
                #endif
                zip_discard(intern);
 #endif
+       } else {
+               ze_obj->err_zip = 0;
+               ze_obj->err_sys = 0;
        }
 
        efree(ze_obj->filename);