mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
radix tree test suite: Fix leaks in regression2.c
None of the malloc'ed data structures were ever being freed. Found with -fsanitize=address. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Reviewed-by: Rehas Sachdeva <aquannie@gmail.com>
This commit is contained in:
parent
18d0c57394
commit
6da0396cac
1 changed files with 4 additions and 2 deletions
|
@ -103,7 +103,7 @@ void regression2_test(void)
|
||||||
|
|
||||||
/* 4. */
|
/* 4. */
|
||||||
for (i = max_slots - 1; i >= 0; i--)
|
for (i = max_slots - 1; i >= 0; i--)
|
||||||
radix_tree_delete(&mt_tree, i);
|
free(radix_tree_delete(&mt_tree, i));
|
||||||
|
|
||||||
/* 5. */
|
/* 5. */
|
||||||
// NOTE: start should not be 0 because radix_tree_gang_lookup_tag_slot
|
// NOTE: start should not be 0 because radix_tree_gang_lookup_tag_slot
|
||||||
|
@ -114,7 +114,9 @@ void regression2_test(void)
|
||||||
PAGECACHE_TAG_TOWRITE);
|
PAGECACHE_TAG_TOWRITE);
|
||||||
|
|
||||||
/* We remove all the remained nodes */
|
/* We remove all the remained nodes */
|
||||||
radix_tree_delete(&mt_tree, max_slots);
|
free(radix_tree_delete(&mt_tree, max_slots));
|
||||||
|
|
||||||
|
BUG_ON(!radix_tree_empty(&mt_tree));
|
||||||
|
|
||||||
printv(1, "regression test 2, done\n");
|
printv(1, "regression test 2, done\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue