Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21e7d4c

Browse files
committed
fix zipimport ref leak
1 parent 5ce3f10 commit 21e7d4c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Modules/zipimport.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,10 +958,8 @@ safely_reopen_archive(ZipImporter *self)
958958
}
959959
Py_XDECREF(self->files); /* free the old value. */
960960
self->files = files;
961-
} else {
962-
/* No problem, discard the new stat data. */
963-
Py_DECREF(stat_now);
964961
}
962+
Py_DECREF(stat_now);
965963
} /* stat succeeded */
966964

967965
return fp;

0 commit comments

Comments
 (0)