mirror of
https://github.com/python/cpython.git
synced 2025-10-24 15:36:26 +00:00
Issue #19437: Cleanup r_ref() of the marshal module
This commit is contained in:
parent
d5cae6f143
commit
359fabc19f
1 changed files with 6 additions and 5 deletions
|
|
@ -827,12 +827,13 @@ r_ref_insert(PyObject *o, Py_ssize_t idx, int flag, RFILE *p)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
r_ref(PyObject *o, int flag, RFILE *p)
|
r_ref(PyObject *o, int flag, RFILE *p)
|
||||||
{
|
{
|
||||||
if (o != NULL && flag) { /* currently only FLAG_REF is defined */
|
assert(flag & FLAG_REF);
|
||||||
|
if (o == NULL)
|
||||||
|
return NULL;
|
||||||
if (PyList_Append(p->refs, o) < 0) {
|
if (PyList_Append(p->refs, o) < 0) {
|
||||||
Py_DECREF(o); /* release the new object */
|
Py_DECREF(o); /* release the new object */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue