Skip to content

Commit 41d4bf9

Browse files
Wulian233clin1234
authored andcommitted
pythongh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (pythonGH-146246)
1 parent c76f76c commit 41d4bf9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)