From 76f2b2416a81380f247637f59a699d42628945e4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 17 Aug 2007 14:33:37 +0000 Subject: [PATCH] Fix refcount leak, courtesy Christian Heines. --- Modules/zipimport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 42cb9d07a97..42bb7a55f3a 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 */