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

[PATCH] use xrealloc in help.c

From
James Bowes <jbowes@dangerouslyinc.com>
Date
Mar 27, 2007, 22:30 UTC
Message-ID
<1175034608589-git-send-email-jbowes@dangerouslyinc.com>
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---
 help.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/help.c b/help.c
index be8651a..34b1dda 100644
--- a/help.c
+++ b/help.c
@@ -54,7 +54,7 @@ static void add_cmdname(const char *name, int len)
 	struct cmdname *ent;
 	if (cmdname_alloc <= cmdname_cnt) {
 		cmdname_alloc = cmdname_alloc + 200;
-		cmdname = realloc(cmdname, cmdname_alloc * sizeof(*cmdname));
+		cmdname = xrealloc(cmdname, cmdname_alloc * sizeof(*cmdname));
 		if (!cmdname)
 			oom();
 	}
-- 
1.5.0.5
Next: Morten Welinder
Message 1 of 3 in “use xrealloc in help.c”
  1. use xrealloc in help.cJames Bowes, Mar 27, 2007
  2. Morten WelinderMar 27, 2007
  3. James BowesMar 28, 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.