commit-graph: use free_commit_graph() instead of UNLEAK()
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>
Ævar Arnfjörð Bjarmason committed
Feb 7, 2023 at 00:07 UTC
e8ed0a8ac5ecb4379018e78188ed3ff489c7cfc5
1 file changed
+4
-2
builtin/commit-graph.c
+4
-2
@@ -67,6 +67,7 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
67
int fd;
68
struct stat st;
69
int flags = 0;
70
+ int ret;
71
72
static struct option builtin_commit_graph_verify_options[] = {
73
OPT_BOOL(0, "shallow", &opts.shallow,
@@ -111,8 +112,9 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
112
if (!graph)
113
return !!open_ok;
114
114
- UNLEAK(graph);
115
- return verify_commit_graph(the_repository, graph, flags);
115
+ ret = verify_commit_graph(the_repository, graph, flags);
116
+ free_commit_graph(graph);
117
+ return ret;
118
}
119
120
extern int read_replace_refs;