diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-01-28 15:11:12 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-01-28 15:11:12 (GMT) |
commit | aaef05f003b11b3679e0d05ab633329fb5579e83 (patch) | |
tree | 9f86fd3c05580ad4e135efb990aa395ffd0bd081 /Python/marshal.c | |
parent | 66acbb28ee6b653b32c361591e7e009ddaf3543c (diff) | |
parent | 000daaee57df015ff541f267ccbe733b4413658f (diff) | |
download | cpython-aaef05f003b11b3679e0d05ab633329fb5579e83.zip cpython-aaef05f003b11b3679e0d05ab633329fb5579e83.tar.gz cpython-aaef05f003b11b3679e0d05ab633329fb5579e83.tar.bz2 |
Fixed memory leak in marshal.
Diffstat (limited to 'Python/marshal.c')
-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 3832085..5acf0de 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1520,8 +1520,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); |