mirror of https://github.com/python/cpython
bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (#30546)
First introduced in 0332e569c1
This commit is contained in:
parent
dce642f244
commit
607d8a838f
|
@ -0,0 +1 @@
|
|||
Fix memory leak in PyEval_EvalCodeEx.
|
|
@ -6128,16 +6128,9 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
|
|||
}
|
||||
allargs = newargs;
|
||||
}
|
||||
PyObject **kwargs = PyMem_Malloc(sizeof(PyObject *)*kwcount);
|
||||
if (kwargs == NULL) {
|
||||
res = NULL;
|
||||
Py_DECREF(kwnames);
|
||||
goto fail;
|
||||
}
|
||||
for (int i = 0; i < kwcount; i++) {
|
||||
Py_INCREF(kws[2*i]);
|
||||
PyTuple_SET_ITEM(kwnames, i, kws[2*i]);
|
||||
kwargs[i] = kws[2*i+1];
|
||||
}
|
||||
PyFrameConstructor constr = {
|
||||
.fc_globals = globals,
|
||||
|
|
Loading…
Reference in New Issue