]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-150546: Fix cleanup for replacement_locations in _PyCode_New() (#150549)
authorstevens <lipengyu@kylinos.cn>
Fri, 24 Jul 2026 11:42:29 +0000 (19:42 +0800)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2026 11:42:29 +0000 (17:12 +0530)
Objects/codeobject.c

index 03036020b1cb1ae64a600da4b25f2cb5888aa710..d7955cc7390a7ab02f312a81979b770fb0fcae63 100644 (file)
@@ -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;
     }