diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-07-05 06:59:06 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-05 06:59:06 (GMT) |
| commit | 9e542f9a46a06247eafb5bc651fa06f3aaaad5eb (patch) | |
| tree | 6a940cf3bcd32e6687e1d8c9a056f97cac5463c5 /Python | |
| parent | de86aaa1609203334e203c3ea37553ec2580d626 (diff) | |
| download | cpython-9e542f9a46a06247eafb5bc651fa06f3aaaad5eb.zip cpython-9e542f9a46a06247eafb5bc651fa06f3aaaad5eb.tar.gz cpython-9e542f9a46a06247eafb5bc651fa06f3aaaad5eb.tar.bz2 | |
[3.12] gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391) (#121393)
gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391)
The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc42f90c151b298f97b780e62703adbf1221)
Co-authored-by: Josh Brobst <jbrobst@proton.me>
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/tracemalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/tracemalloc.c b/Python/tracemalloc.c index bc76562..e13064b 100644 --- a/Python/tracemalloc.c +++ b/Python/tracemalloc.c @@ -836,7 +836,7 @@ _PyTraceMalloc_Init(void) tracemalloc_tracebacks = hashtable_new(hashtable_hash_traceback, hashtable_compare_traceback, - NULL, raw_free); + raw_free, NULL); tracemalloc_traces = tracemalloc_create_traces_table(); tracemalloc_domains = tracemalloc_create_domains_table(); |
