We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 66acbb2 + 000daae commit aaef05fCopy full SHA for aaef05f
1 file changed
Python/marshal.c
@@ -1520,8 +1520,10 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
1520
wf.depth = 0;
1521
wf.version = version;
1522
if (version >= 3) {
1523
- if ((wf.refs = PyDict_New()) == NULL)
+ if ((wf.refs = PyDict_New()) == NULL) {
1524
+ Py_DECREF(wf.str);
1525
return NULL;
1526
+ }
1527
} else
1528
wf.refs = NULL;
1529
w_object(x, &wf);
0 commit comments