summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-17 14:33:37 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-17 14:33:37 (GMT)
commit76f2b2416a81380f247637f59a699d42628945e4 (patch)
treebbb3cc12105e52b6d39ee05d125fdc13c46c0603 /Modules
parenteb33e5ae79542371a165bdb67099d14b7557a698 (diff)
downloadcpython-76f2b2416a81380f247637f59a699d42628945e4.zip
cpython-76f2b2416a81380f247637f59a699d42628945e4.tar.gz
cpython-76f2b2416a81380f247637f59a699d42628945e4.tar.bz2
Fix refcount leak, courtesy Christian Heines.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/zipimport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 42cb9d0..42bb7a5 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -852,8 +852,9 @@ get_data(char *archive, PyObject *toc_entry)
buf[data_size] = '\0';
if (compress == 0) { /* data is not compressed */
- raw_data = PyBytes_FromStringAndSize(buf, data_size);
- return raw_data;
+ data = PyBytes_FromStringAndSize(buf, data_size);
+ Py_DECREF(raw_data);
+ return data;
}
/* Decompress with zlib */