Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e542f9

Browse files
[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 db39bc4) Co-authored-by: Josh Brobst <[email protected]>
1 parent de86aaa commit 9e542f9

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
@@ -836,7 +836,7 @@ _PyTraceMalloc_Init(void)
836836

837837
tracemalloc_tracebacks = hashtable_new(hashtable_hash_traceback,
838838
hashtable_compare_traceback,
839-
NULL, raw_free);
839+
raw_free, NULL);
840840

841841
tracemalloc_traces = tracemalloc_create_traces_table();
842842
tracemalloc_domains = tracemalloc_create_domains_table();

0 commit comments

Comments
 (0)