Skip to content

Commit acba269

Browse files
committed
fix error check
1 parent ba36d01 commit acba269

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Modules/_functoolsmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,14 @@ partial_vectorcall(partialobject *pto, PyObject *const *args,
448448
if (PyDict_Contains(pto->kw, key)) {
449449
if (pto_kw == NULL) {
450450
pto_kw = PyDict_Copy(pto->kw);
451+
if (pto_kw == NULL) {
452+
DEALLOCATE_STACK(small_kwtail, kwtail);
453+
return NULL;
454+
}
451455
}
452456
if (PyDict_SetItem(pto_kw, key, val)) {
453457
DEALLOCATE_STACK(small_kwtail, kwtail);
458+
Py_DECREF(pto_kw);
454459
return NULL;
455460
}
456461
}

0 commit comments

Comments
 (0)