https://github.com/python/cpython/commit/9343518c6f413b2231b17c56065e5cf823aa0d2a
commit: 9343518c6f413b2231b17c56065e5cf823aa0d2a
branch: main
author: Wulian233 <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-03-25T19:09:56Z
summary:

gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure 
(GH-146246)

files:
M Python/initconfig.c

diff --git a/Python/initconfig.c b/Python/initconfig.c
index caf42f5247c2f2..8dc9602ff13df7 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -511,7 +511,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); \

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to