]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/helper: fix leaking commit graph in "read-graph" subcommand
authorPatrick Steinhardt <ps@pks.im>
Wed, 20 Nov 2024 13:39:49 +0000 (14:39 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Nov 2024 23:23:45 +0000 (08:23 +0900)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-read-graph.c

index 9018c9f54122833eaf9dde52ced06e354e1919ef..811dde1cb3c8809352f79428a589c2158fc62545 100644 (file)
@@ -97,7 +97,6 @@ int cmd__read_graph(int argc, const char **argv)
        }
 
 done:
-       UNLEAK(graph);
-
+       free_commit_graph(graph);
        return ret;
 }