gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (GH-146246)
diff --git a/Python/initconfig.c b/Python/initconfig.c index caf42f5..8dc9602 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); \