[PATCH 20/26] t/helper: fix leaking commit graph in "read-graph" subcommand
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 6, 2024, 15:11 UTC
- Message-ID
- <6439796a0bcc709febbce62277769d680992a44b.1730901926.git.ps@pks.im>
- In-Reply-To
- <cover.1730901926.git.ps@pks.im>
We're leaking the commit-graph in the "test-helper read-graph" subcommand, but as the leak is annotated with `UNLEAK()` the leak sanitizer doesn't complain.
Fix the leak by calling `free_commit_graph()`. Besides getting rid of the `UNLEAK()` annotation, it also increases code coverage because we properly release resources as Git would do it, as well.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- t/helper/test-read-graph.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/helper/test-read-graph.c b/t/helper/test-read-graph.c index 9018c9f5412..811dde1cb3c 100644 --- a/t/helper/test-read-graph.c +++ b/t/helper/test-read-graph.c @@ -97,7 +97,6 @@ int cmd__read_graph(int argc, const char **argv) } done: - UNLEAK(graph); - + free_commit_graph(graph); return ret; }
-- 2.47.0.229.g8f8d6eee53.dirty