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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user