Skip to content

Commit 92893fd

Browse files
authored
gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (#121136)
PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
1 parent e6543da commit 92893fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_pickle.c

+2
Original file line numberDiff line numberDiff line change
@@ -6524,11 +6524,13 @@ load_additems(PickleState *state, UnpicklerObject *self)
65246524
if (result == NULL) {
65256525
Pdata_clear(self->stack, i + 1);
65266526
Py_SET_SIZE(self->stack, mark);
6527+
Py_DECREF(add_func);
65276528
return -1;
65286529
}
65296530
Py_DECREF(result);
65306531
}
65316532
Py_SET_SIZE(self->stack, mark);
6533+
Py_DECREF(add_func);
65326534
}
65336535

65346536
return 0;

0 commit comments

Comments
 (0)