Skip to content

Memory leak if math.dist raises exception #98897

Closed
@kumaraditya303

Description

@kumaraditya303

Reproducer:

import math
try:
    math.dist([1, 2], [3, 4, 5])
except ValueError:
    pass

Memory leak:

@kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python -X showrefcount main.py 
[7 refs, 2 blocks]

Python Version: main at 9bdec0a

Metadata

Metadata

Assignees

Labels

3.10only security fixes3.11only security fixes3.12bugs and security fixeseasytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions