Commit 000daaee authored by Serhiy Storchaka's avatar Serhiy Storchaka

Fixed memory leak in marshal.

parent e09bcc87
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment