[Python-checkins] cpython (2.7): fix refleak in error condition

benjamin.peterson python-checkins at python.org
Thu Jan 21 01:08:05 EST 2016


https://hg.python.org/cpython/rev/7ec954b9fc54
changeset:   100011:7ec954b9fc54
branch:      2.7
parent:      100007:394ae9efc5c2
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Jan 20 22:06:43 2016 -0800
summary:
  fix refleak in error condition

files:
  Modules/zipimport.c |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Modules/zipimport.c b/Modules/zipimport.c
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -908,6 +908,7 @@
         bytes_read = fread(buf, 1, data_size, fp);
     } else {
         fclose(fp);
+        Py_DECREF(raw_data);
         PyErr_Format(ZipImportError, "can't read Zip file: %s", archive);
         return NULL;
     }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list