From: Serhiy Storchaka Date: Wed, 28 Jan 2015 15:10:48 +0000 (+0200) Subject: Fixed memory leak in marshal. X-Git-Tag: v3.4.3rc1~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=000daaee57df015ff541f267ccbe733b4413658f;p=thirdparty%2FPython%2Fcpython.git Fixed memory leak in marshal. --- diff --git a/Python/marshal.c b/Python/marshal.c index bb5faf329754..6f0ee5e83edd 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);