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

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

index 6417dffbb1e5f3ab80189a461e651fc1b6dd95b7..61570f880d9f5e959f5e8fc4b312b61977ea9592 100644 (file)
@@ -353,7 +353,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); \