mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Fixed memory leak in marshal.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user