]> granicus.if.org Git - python/commitdiff
fix refleak in error condition
authorBenjamin Peterson <benjamin@python.org>
Thu, 21 Jan 2016 06:06:43 +0000 (22:06 -0800)
committerBenjamin Peterson <benjamin@python.org>
Thu, 21 Jan 2016 06:06:43 +0000 (22:06 -0800)
Modules/zipimport.c

index f2cc245b7d88d24f0b8b223781c2da2c70e8b038..55bfb5d7cf7d78a0ea978d71d7a726a785a77073 100644 (file)
@@ -1127,6 +1127,7 @@ get_data(PyObject *archive, PyObject *toc_entry)
         bytes_read = fread(buf, 1, data_size, fp);
     } else {
         fclose(fp);
+        Py_DECREF(raw_data);
         PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
         return NULL;
     }