summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJosh Brobst <jbrobst@proton.me>2024-07-05 06:39:48 (GMT)
committerGitHub <noreply@github.com>2024-07-05 06:39:48 (GMT)
commitdb39bc42f90c151b298f97b780e62703adbf1221 (patch)
treecc267e743fc2a547a8638e37389bb5fdda1918b7 /Python
parentcb688bab08559079d0ee9ffd841dd6eb11116181 (diff)
downloadcpython-db39bc42f90c151b298f97b780e62703adbf1221.zip
cpython-db39bc42f90c151b298f97b780e62703adbf1221.tar.gz
cpython-db39bc42f90c151b298f97b780e62703adbf1221.tar.bz2
gh-121390: tracemalloc: Fix tracebacks memory leak (#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.
Diffstat (limited to 'Python')
-rw-r--r--Python/tracemalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/tracemalloc.c b/Python/tracemalloc.c
index fee7dd0..e58b60d 100644
--- a/Python/tracemalloc.c
+++ b/Python/tracemalloc.c
@@ -838,7 +838,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();