Skip to content

Commit

Permalink
commit-graph: remove unnecessary UNLEAK
Browse files Browse the repository at this point in the history
When f4dbdfc (commit-graph: clean up leaked memory during write,
2018-10-03) added the UNLEAK, it was right before a call to die_errno().
e103f72 (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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
rscharfe authored and gitster committed Sep 23, 2024
1 parent 94b60ad commit ff0eb72
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion commit-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff0eb72

Please sign in to comment.