Guido van Rossum wrote:
> There's still one leak that Neal would like to see fixed, in
> test_zipimport. Instructions to reproduce: in a *debug* build, run
> this command:
>
> ./python Lib/test/regrtest.py -R1:1: test_zipimport
>
> This reports 29 leaked references.
>
Err, this patch is using a better name for the data. *blush*
Index: Modules/zipimport.c
===================================================================
--- Modules/zipimport.c (Revision 57115)
+++ Modules/zipimport.c (Arbeitskopie)
@@ -851,10 +851,11 @@
}
buf[data_size] = '\0';
- if (compress == 0) { /* data is not compressed */
- raw_data = PyBytes_FromStringAndSize(buf, data_size);
- return raw_data;
- }
+ if (compress == 0) { /* data is not compressed */
+ data = PyBytes_FromStringAndSize(buf, data_size);
+ Py_DECREF(raw_data);
+ return data;
+ }
/* Decompress with zlib */
decompress = get_decompress_func();
Christian
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com