8000 tracemalloc: Fix tracebacks memory leak · python/cpython@583bc41 · GitHub
[go: up one dir, main page]

Skip to content

Commit 583bc41

Browse files
committed
tracemalloc: Fix tracebacks memory leak
The tracemallocs_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.
1 parent cb688ba commit 583bc41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/tracemalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ _PyTraceMalloc_Init(void)
838838

839839
tracemalloc_tracebacks = hashtable_new(hashtable_hash_traceback,
840840
hashtable_compare_traceback,
841-
NULL, raw_free);
841+
raw_free, NULL);
842842

843843
tracemalloc_traces = tracemalloc_create_traces_table();
844844
tracemalloc_domains = tracemalloc_create_domains_table();

0 commit comments

Comments
 (0)
0