Content-Length: 282898 | pFad | https://github.com/python/cpython/issues/146244

87 initconfig.c: `SET_ITEM` macro leaks dict on expression failure · Issue #146244 · python/cpython · GitHub
Skip to content

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

@Wulian233

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

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









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/146244

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy