]> 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 ff8dedf7798433535423fc8ad251de43148d51a0..24439e019709468483c624f9cad4bf367cc7e9a1 100644 (file)
@@ -832,10 +832,8 @@ safely_reopen_archive(ZipImporter *self, char **archive_p)
             }
             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;