]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 27 Mar 2026 02:37:53 +0000 (03:37 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Mar 2026 02:37:53 +0000 (02:37 +0000)
(cherry picked from commit 9343518c6f413b2231b17c56065e5cf823aa0d2a)

Co-authored-by: Wulian233 <1055917385@qq.com>
Python/initconfig.c

index 75fe3b0976886917252198c86621468170933380..4b0d665b9b1c90e56a1c9ddd372d4fc7fde9eff0 100644 (file)
@@ -502,7 +502,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
         do { \
             obj = (EXPR); \
             if (obj == NULL) { \
-                return NULL; \
+                goto fail; \
             } \
             int res = PyDict_SetItemString(dict, (KEY), obj); \
             Py_DECREF(obj); \