From ef9cf0835230398bb1af134eabaef7c3cad0bce3 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 20 Jan 2016 22:06:43 -0800 Subject: [PATCH] fix refleak in error condition --- Modules/zipimport.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/zipimport.c b/Modules/zipimport.c index f2cc245b7d8..55bfb5d7cf7 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -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; }