summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-25 21:11:54 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-25 21:11:54 (GMT)
commit5f95257ef9a4ec72963b6bb5f6b056a52d5c010f (patch)
tree49cba4d3def2ee9eee1cd692e558b35e469a76af /Modules/_pickle.c
parent7317c1ef7aaba7deda66b7fa917d09e68d83635b (diff)
downloadcpython-5f95257ef9a4ec72963b6bb5f6b056a52d5c010f.zip
cpython-5f95257ef9a4ec72963b6bb5f6b056a52d5c010f.tar.gz
cpython-5f95257ef9a4ec72963b6bb5f6b056a52d5c010f.tar.bz2
#4373: Reference leak in the pickle module.
Reviewed by Brett Cannon.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index c1facd8..a0810b9 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -486,11 +486,13 @@ unpickler_read(UnpicklerObject *self, char **s, Py_ssize_t n)
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;
}