mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
tests: fix a memory leak in test-prio-queue.c
Fix a memory leak in t/helper/test-prio-queue.c, the lack of freeing
the memory with clear_prio_queue() has been there ever since this code
was originally added in b4b594a315
(prio-queue: priority queue of
pointers to structs, 2013-06-06).
By fixing this leak we can cleanly run t0009-prio-queue.sh under
SANITIZE=leak, so annotate it as such with
TEST_PASSES_SANITIZE_LEAK=true.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6cb3deb451
commit
6a75658c0a
@ -46,5 +46,7 @@ int cmd__prio_queue(int argc, const char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
clear_prio_queue(&pq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='basic tests for priority queue implementation'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
cat >expect <<'EOF'
|
||||
|
Loading…
Reference in New Issue
Block a user