Skip to content

Commit e71c242

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 5a4959b commit e71c242

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
@@ -353,7 +353,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
353353
do { \
354354
obj = (EXPR); \
355355
if (obj == NULL) { \
356-
return NULL; \
356+
goto fail; \
357357
} \
358358
int res = PyDict_SetItemString(dict, (KEY), obj); \
359359
Py_DECREF(obj); \

0 commit comments

Comments
 (0)