Skip to content

Commit 50ea640

Browse files
[3.13] gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136) (#121139)
gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-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 (cherry picked from commit 92893fd) Co-authored-by: Justin Applegate <[email protected]>
1 parent 58a3c3c commit 50ea640

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)