Skip to content

Commit

Permalink
labels removed
Browse files Browse the repository at this point in the history
  • Loading branch information
dg-pb committed Jan 6, 2025
1 parent 1a8a56c commit b3ff73d
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,18 @@ partial_vectorcall(PyObject *self, PyObject *const *args,
if (pto_kw_merged == NULL) {
pto_kw_merged = PyDict_Copy(pto->kw);
if (pto_kw_merged == NULL) {
goto error_2;
if (stack != small_stack) {
PyMem_Free(stack);
}
return NULL;
}
}
if (PyDict_SetItem(pto_kw_merged, key, val) < 0) {
goto error_1;
Py_XDECREF(pto_kw_merged);
if (stack != small_stack) {
PyMem_Free(stack);
}
return NULL;
}
}
else {
Expand Down Expand Up @@ -497,8 +504,13 @@ partial_vectorcall(PyObject *self, PyObject *const *args,
if (n_merges && stack != small_stack) {
tmp_stack = PyMem_Realloc(stack, (tot_nargskw - n_merges) * sizeof(PyObject *));
if (tmp_stack == NULL) {
Py_DECREF(tot_kwnames);
Py_XDECREF(pto_kw_merged);
if (stack != small_stack) {
PyMem_Free(stack);
}
PyErr_NoMemory();
goto error_0;
return NULL;
}
stack = tmp_stack;
}
Expand Down Expand Up @@ -539,16 +551,6 @@ partial_vectorcall(PyObject *self, PyObject *const *args,
Py_DECREF(tot_kwnames);
}
return ret;

error_0:
Py_DECREF(tot_kwnames);
error_1:
Py_XDECREF(pto_kw_merged);
error_2:
if (stack != small_stack) {
PyMem_Free(stack);
}
return NULL;
}

/* Set pto->vectorcall depending on the parameters of the partial object */
Expand Down

0 comments on commit b3ff73d

Please sign in to comment.