Skip to content

Commit 760194e

Browse files
Wulian233miss-islington
authored andcommitted
gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (GH-146246)
(cherry picked from commit 9343518) Co-authored-by: Wulian233 <1055917385@qq.com>
1 parent c8e0ead commit 760194e

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
@@ -502,7 +502,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
502502
do { \
503503
obj = (EXPR); \
504504
if (obj == NULL) { \
505-
return NULL; \
505+
goto fail; \
506506
} \
507507
int res = PyDict_SetItemString(dict, (KEY), obj); \
508508
Py_DECREF(obj); \

0 commit comments

Comments
 (0)