git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] commit-graph: remove unnecessary UNLEAK

From
René Scharfe <l.s.r@web.de>
Date
Sep 22, 2024, 13:40 UTC
Message-ID
<c3a712d5-8e50-453d-be90-f5bf34de744c@web.de>

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
Message 1 of 1 in “commit-graph: remove unnecessary UNLEAK”
  1. commit-graph: remove unnecessary UNLEAKRené Scharfe, Sep 22, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.