From: stevens Date: Fri, 24 Jul 2026 11:42:29 +0000 (+0800) Subject: gh-150546: Fix cleanup for replacement_locations in _PyCode_New() (#150549) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a096314ca940285714d5e3928c7e47cf7aebb1cc;p=thirdparty%2FPython%2Fcpython.git gh-150546: Fix cleanup for replacement_locations in _PyCode_New() (#150549) --- diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 03036020b1cb..d7955cc7390a 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -748,6 +748,7 @@ _PyCode_New(struct _PyCodeConstructor *con) #endif if (init_code(co, con) < 0) { + Py_XDECREF(replacement_locations); Py_DECREF(co); return NULL; }