git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] commit-graph: remove unnecessary UNLEAK
@ 2024-09-22 13:40 René Scharfe
  0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2024-09-22 13:40 UTC (permalink / raw)
  To: Git List; +Cc: Derrick Stolee

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>
---
 commit-graph.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/commit-graph.c b/commit-graph.c
index aa6e08eb39..5bd89c0acd 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -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;
--
2.46.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-22 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 13:40 [PATCH] commit-graph: remove unnecessary UNLEAK René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).