Skip to content

Commit adacecf

Browse files
committed
null fix
1 parent 8730ded commit adacecf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Modules/_functoolsmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,12 @@ partial_vectorcall(PyObject *self, PyObject *const *args,
489489

490490
/* Create total kwnames */
491491
tot_kwnames = PyTuple_New(tot_nkwds - n_merges);
492+
if (tot_kwnames == NULL) {
493+
if (stack != small_stack) {
494+
PyMem_Free(stack);
495+
}
496+
return NULL;
497+
}
492498
for (Py_ssize_t i = 0; i < n_tail; ++i) {
493499
key = Py_NewRef(stack[tot_nargskw + i]);
494500
PyTuple_SET_ITEM(tot_kwnames, pto_nkwds + i, key);

0 commit comments

Comments
 (0)