cpython: 2d352bf2b228 (original) (raw)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.6.0 beta 3 Core and Builtins ----------------- +- Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception

--- a/Python/traceback.c +++ b/Python/traceback.c @@ -132,47 +132,53 @@ newtracebackobject(PyTracebackObject *ne int PyTraceBack_Here(PyFrameObject *frame) {

/* Insert a frame into the traceback for (funcname, filename, lineno). */ void _PyTraceback_Add(const char *funcname, const char *filename, int lineno) {

/* Save and clear the current exception. Python functions must not be called with an exception set. Calling Python functions happens when the codec of the filesystem encoding is implemented in pure Python. */

globals = PyDict_New(); if (!globals)

-done:

+error:

} static PyObject *