Commit f8c06b02 authored by Alexey Izbyshev's avatar Alexey Izbyshev Committed by Serhiy Storchaka

bpo-34456: pickle: Add missing NULL check to save_global(). (GH-8851)

Reported by Svace static analyzer.
parent ef8861c1
......@@ -3454,6 +3454,8 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
PickleState *st = _Pickle_GetGlobalState();
PyObject *reduce_value = Py_BuildValue("(O(OO))",
st->getattr, parent, lastname);
if (reduce_value == NULL)
goto error;
status = save_reduce(self, reduce_value, NULL);
Py_DECREF(reduce_value);
if (status < 0)
......
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