Skip to content

PyEval_GetLocals() leaks locals #118934

Closed
Closed
@colesbury

Description

@colesbury

Bug report

PyEval_GetLocals() is documented as returning a borrowed reference. It now returns a new reference, which causes callers to leak the local variables:

cpython/Python/ceval.c

Lines 2478 to 2479 in 35c4361

PyObject *locals = _PyEval_GetFrameLocals();
return locals;

cc @gaogaotiantian @markshannon

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixestopic-C-APItype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions