Commit 5397cc03 authored by Victor Stinner's avatar Victor Stinner

Issue #19437: Cleanup r_ref() of the marshal module

parent cd653906
......@@ -827,11 +827,12 @@ r_ref_insert(PyObject *o, Py_ssize_t idx, int flag, RFILE *p)
static PyObject *
r_ref(PyObject *o, int flag, RFILE *p)
{
if (o != NULL && flag) { /* currently only FLAG_REF is defined */
if (PyList_Append(p->refs, o) < 0) {
Py_DECREF(o); /* release the new object */
return NULL;
}
assert(flag & FLAG_REF);
if (o == NULL)
return NULL;
if (PyList_Append(p->refs, o) < 0) {
Py_DECREF(o); /* release the new object */
return NULL;
}
return o;
}
......
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