]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit-graph: remove unnecessary UNLEAK
authorRené Scharfe <l.s.r@web.de>
Sun, 22 Sep 2024 13:40:42 +0000 (15:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Sep 2024 17:03:59 +0000 (10:03 -0700)
When f4dbdfc4d5 (commit-graph: clean up leaked memory during write,
2018-10-03) added the UNLEAK, it was right before a call to die_errno().
e103f7276f (commit-graph: return with errors during write, 2019-06-12)
made it unnecessary, as it was then followed by a free() call for the
allocated string.

The code moved to write_commit_graph_file() in the meantime and the
string pointer is now part of a struct, but the function's only caller
still cleans up the allocation.  Drop the superfluous UNLEAK.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c

index aa6e08eb39cd5fc7b1bc0d5b171641d59cd77e72..5bd89c0acdd03df1328d75707136cfd2937582a5 100644 (file)
@@ -2055,7 +2055,6 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
        }
 
        if (safe_create_leading_directories(ctx->graph_name)) {
-               UNLEAK(ctx->graph_name);
                error(_("unable to create leading directories of %s"),
                        ctx->graph_name);
                return -1;