Skip to content

Commit e8ed0a8

Browse files
avargitster
authored andcommitted
commit-graph: use free_commit_graph() instead of UNLEAK()
In 0bfb48e (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 c3756d5 (commit-graph: add free_commit_graph, 2018-07-11) instead. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53537c6 commit e8ed0a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

builtin/commit-graph.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
6767
int fd;
6868
struct stat st;
6969
int flags = 0;
70+
int ret;
7071

7172
static struct option builtin_commit_graph_verify_options[] = {
7273
OPT_BOOL(0, "shallow", &opts.shallow,
@@ -111,8 +112,9 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
111112
if (!graph)
112113
return !!open_ok;
113114

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;
116118
}
117119

118120
extern int read_replace_refs;

0 commit comments

Comments
 (0)