Skip to content

Commit b1a94f1

Browse files
miss-islington1st1
andauthored
bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (GH-30546)
First introduced in 0332e56 (cherry picked from commit 607d8a8) Co-authored-by: Yury Selivanov <[email protected]>
1 parent 6f035c0 commit b1a94f1

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix memory leak in PyEval_EvalCodeEx.

Python/ceval.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5132,16 +5132,9 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
51325132
}
51335133
allargs = newargs;
51345134
}
5135-
PyObject **kwargs = PyMem_Malloc(sizeof(PyObject *)*kwcount);
5136-
if (kwargs == NULL) {
5137-
res = NULL;
5138-
Py_DECREF(kwnames);
5139-
goto fail;
5140-
}
51415135
for (int i = 0; i < kwcount; i++) {
51425136
Py_INCREF(kws[2*i]);
51435137
PyTuple_SET_ITEM(kwnames, i, kws[2*i]);
5144-
kwargs[i] = kws[2*i+1];
51455138
}
51465139
PyFrameConstructor constr = {
51475140
.fc_globals = globals,

0 commit comments

Comments
 (0)