Fix refcount leak, courtesy Christian Heines.

This commit is contained in:
Guido van Rossum 2007-08-17 14:33:37 +00:00
parent eb33e5ae79
commit 76f2b2416a
1 changed files with 3 additions and 2 deletions

View File

@ -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 */