Discussion:
[Python-3000-checkins] r67381 - in python/branches/py3k: Misc/NEWS Modules/_pickle.c
amaury.forgeotdarc
2008-11-25 21:12:07 UTC
Permalink
Author: amaury.forgeotdarc
Date: Tue Nov 25 22:11:54 2008
New Revision: 67381

Log:
#4373: Reference leak in the pickle module.

Reviewed by Brett Cannon.


Modified:
python/branches/py3k/Misc/NEWS
python/branches/py3k/Modules/_pickle.c

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS (original)
+++ python/branches/py3k/Misc/NEWS Tue Nov 25 22:11:54 2008
@@ -22,6 +22,8 @@
Library
-------

+- Issue #4373: Corrected a potential reference leak in the pickle module.
+
- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
files.


Modified: python/branches/py3k/Modules/_pickle.c
==============================================================================
--- python/branches/py3k/Modules/_pickle.c (original)
+++ python/branches/py3k/Modules/_pickle.c Tue Nov 25 22:11:54 2008
@@ -486,11 +486,13 @@
PyErr_SetString(PyExc_ValueError,
"read() from the underlying stream did not"
"return bytes");
+ Py_DECREF(data);
return -1;
}

if (PyBytes_GET_SIZE(data) != n) {
PyErr_SetNone(PyExc_EOFError);
+ Py_DECREF(data);
return -1;
}

Loading...