diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-01-28 15:10:48 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-01-28 15:10:48 (GMT) |
commit | 000daaee57df015ff541f267ccbe733b4413658f (patch) | |
tree | 782b0edff4a65f058259bdc1efd8b3381d3e3d36 /Python | |
parent | e09bcc874a21ce351a7fe73b9a137e236550d03c (diff) | |
download | cpython-000daaee57df015ff541f267ccbe733b4413658f.zip cpython-000daaee57df015ff541f267ccbe733b4413658f.tar.gz cpython-000daaee57df015ff541f267ccbe733b4413658f.tar.bz2 |
Fixed memory leak in marshal.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/marshal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index bb5faf3..6f0ee5e 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1522,8 +1522,10 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) wf.depth = 0; wf.version = version; if (version >= 3) { - if ((wf.refs = PyDict_New()) == NULL) + if ((wf.refs = PyDict_New()) == NULL) { + Py_DECREF(wf.str); return NULL; + } } else wf.refs = NULL; w_object(x, &wf); |