gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (#121136)
https://github.com/python/cpython/commit/92893fd8dc803ed7cdde55d29d25f84ccb5... commit: 92893fd8dc803ed7cdde55d29d25f84ccb5e3ef0 branch: main author: Justin Applegate <70449145+Legoclones@users.noreply.github.com> committer: gaogaotiantian <gaogaotiantian@hotmail.com> date: 2024-06-28T14:43:45-07:00 summary: 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 files: M Modules/_pickle.c diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 21be88a79d8705..4a2191db0cf984 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6524,11 +6524,13 @@ load_additems(PickleState *state, UnpicklerObject *self) if (result == NULL) { Pdata_clear(self->stack, i + 1); Py_SET_SIZE(self->stack, mark); + Py_DECREF(add_func); return -1; } Py_DECREF(result); } Py_SET_SIZE(self->stack, mark); + Py_DECREF(add_func); } return 0;
participants (1)
-
gaogaotiantian