]> granicus.if.org Git - python/commitdiff
fix zipimport ref leak
authorBenjamin Peterson <benjamin@python.org>
Thu, 9 Jan 2014 15:36:10 +0000 (09:36 -0600)
committerBenjamin Peterson <benjamin@python.org>
Thu, 9 Jan 2014 15:36:10 +0000 (09:36 -0600)
Modules/zipimport.c

index bfac46233db06bc0b1d7ec69672807cf274d9d8e..fc6c0e4dc2419d7de7bf2b87b16ff62920b90a8b 100644 (file)
@@ -958,10 +958,8 @@ safely_reopen_archive(ZipImporter *self)
             }
             Py_XDECREF(self->files);  /* free the old value. */
             self->files = files;
-        } else {
-            /* No problem, discard the new stat data. */
-            Py_DECREF(stat_now);
         }
+        Py_DECREF(stat_now);
     }  /* stat succeeded */
 
     return fp;