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

(cherry picked from commit 9343518c6f)

Co-authored-by: Wulian233 <1055917385@qq.com>
This commit is contained in:
Miss Islington (bot) 2026-03-25 20:32:20 +01:00 committed by GitHub
parent 5a4959b92c
commit fc4b4221e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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); \