Skip to content

Commit 9343518

Browse files
authored
gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (GH-146246)
1 parent 4447f23 commit 9343518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/initconfig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
511511
do { \
512512
obj = (EXPR); \
513513
if (obj == NULL) { \
514-
return NULL; \
514+
goto fail; \
515515
} \
516516
int res = PyDict_SetItemString(dict, (KEY), obj); \
517517
Py_DECREF(obj); \

0 commit comments

Comments
 (0)