[New-bugs-announce] [issue46347] memory leak in PyEval_EvalCodeEx

Yury Selivanov report at bugs.python.org
Tue Jan 11 16:06:10 EST 2022

New submission from Yury Selivanov <yselivanov at gmail.com>:

I'm investigating a memory leak in 3.10, and while looking at the offending commit I stumbled upon this: in ceval.c:PyEval_EvalCodeEx, there's this allocation:

    PyObject **kwargs = PyMem_Malloc(sizeof(PyObject *)*kwcount);

The problem is that this isn't ever freed. And `kwargs` isn't used anywhere in the function body. It seems to me that this is silently leaking memory.

messages: 410329
nosy: Elvis.Pranskevichus, Mark.Shannon, pablogsal, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: memory leak in PyEval_EvalCodeEx

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list