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

This commit is contained in:
Wulian233 2026-03-26 03:09:56 +08:00 committed by GitHub
parent 4447f23f40
commit 9343518c6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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