Skip to content

initconfig.c: SET_ITEM macro leaks dict on expression failure #146244

Closed

Description

@Wulian233

Bug report

Bug description:

Parent: #146102

SET_ITEM macro at line 510-521: when the expression (e.g., PyLong_FromLong) returns NULL, return NULL at line 514 leaks the dict allocated at line 505. The PyDict_SetItemString failure path correctly uses goto fail.

CPython versions tested on:

CPython main branch

Linked PRs

Activity

  1. Wulian233 commented on Mar 21, 2026

    @Wulian233
    ContributorAuthor

    I’m currently unable to add the parent issue #146102 . I would appreciate it if someone could help add it:)

  2. added a commit that references this issue on Mar 25, 2026
  3. added 2 commits that reference this issue on Mar 25, 2026
  4. added 2 commits that reference this issue on Mar 25, 2026
  5. added a commit that references this issue on Apr 16, 2026
  6. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions