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

[PATCH 5/5] init_buffer(): Kill buf pointer

From
LCLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Date
Apr 25, 2007, 14:18 UTC
Message-ID
<20070425111841.2c491281@localhost>
We don't need it, it's possible to assign the block of memory to bufp
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
---
 builtin-commit-tree.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c
index 4a8d8d8..ccbcbe3 100644
--- a/builtin-commit-tree.c
+++ b/builtin-commit-tree.c
@@ -16,9 +16,8 @@
  */
 static void init_buffer(char **bufp, unsigned int *sizep)
 {
-	char *buf = xmalloc(BLOCKING);
+	*bufp = xmalloc(BLOCKING);
 	*sizep = 0;
-	*bufp = buf;
 }
 
 static void add_buffer(char **bufp, unsigned int *sizep, const char *fmt, ...)
-- 
1.5.1.1.320.g1cf2
Message 1 of 1 in “init_buffer(): Kill buf pointer”
  1. 5/5 init_buffer(): Kill buf pointerLuiz Fernando N. Capitulino, Apr 25, 2007

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.