https://github.com/python/cpython/commit/4d61fd6b7a706762d962c4a23313d57167796a12 commit: 4d61fd6b7a706762d962c4a23313d57167796a12 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-03-27T02:37:53Z summary:
[3.14] gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (GH-146246) (GH-146432) (cherry picked from commit 9343518c6f413b2231b17c56065e5cf823aa0d2a) Co-authored-by: Wulian233 <[email protected]> files: M Python/initconfig.c diff --git a/Python/initconfig.c b/Python/initconfig.c index 75fe3b09768869..4b0d665b9b1c90 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -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); \ _______________________________________________ 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]
