]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit-graph: use free_commit_graph() instead of UNLEAK()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:38 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:36 +0000 (15:34 -0800)
In 0bfb48e6723 (builtin/commit-graph.c: UNLEAK variables, 2018-10-03)
this was made to UNLEAK(), but we can just as easily invoke the
free_commit_graph() function added in c3756d5b7fc (commit-graph: add
free_commit_graph, 2018-07-11) instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit-graph.c

index e8f77f535f3075405853f6ff6d4fdf40a4b019af..0102ac8540ead7d565acf2cb97a1746eb14378d0 100644 (file)
@@ -67,6 +67,7 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
        int fd;
        struct stat st;
        int flags = 0;
+       int ret;
 
        static struct option builtin_commit_graph_verify_options[] = {
                OPT_BOOL(0, "shallow", &opts.shallow,
@@ -111,8 +112,9 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
        if (!graph)
                return !!open_ok;
 
-       UNLEAK(graph);
-       return verify_commit_graph(the_repository, graph, flags);
+       ret = verify_commit_graph(the_repository, graph, flags);
+       free_commit_graph(graph);
+       return ret;
 }
 
 extern int read_replace_refs;