Skip to content

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

Open
Wulian233 wants to merge 5 commits intopython:mainfrom
Wulian233:initconfig
Open

gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure#146246
Wulian233 wants to merge 5 commits intopython:mainfrom
Wulian233:initconfig

Conversation

@Wulian233
Copy link
Contributor

@Wulian233 Wulian233 commented Mar 21, 2026

@Wulian233
Copy link
Contributor Author

@serhiy-storchaka Could you please help review this PR? Thank you very much!

@@ -0,0 +1,2 @@
Fix memory leak in ``SET_ITEM`` macro in ``initconfig.c`` when expression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SET_ITEM and initconfig.c are implementation details not visibly to the user.

Since it is difficult to reproduce the leak (it will likely happens when the Python interpreter fails to launch, and all program memory will be freed in any case), I think that a NEWS entry is not required for this change.

Copy link
Contributor Author

@Wulian233 Wulian233 Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted :)

@serhiy-storchaka serhiy-storchaka added skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants