https://github.com/python/cpython/commit/fc4b4221e5f6cf53e61ccbf716165d6192b9fd40 commit: fc4b4221e5f6cf53e61ccbf716165d6192b9fd40 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-03-25T19:32:20Z summary:
[3.13] gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (GH-146246) (GH-146433) (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 6417dffbb1e5f3..61570f880d9f5e 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -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); \ _______________________________________________ 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]
