From a096314ca940285714d5e3928c7e47cf7aebb1cc Mon Sep 17 00:00:00 2001 From: stevens Date: Fri, 24 Jul 2026 19:42:29 +0800 Subject: [PATCH] gh-150546: Fix cleanup for replacement_locations in _PyCode_New() (#150549) --- Objects/codeobject.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.47.3