Skip to contentSkip to conversation

use xmalloc in git.c and help.c

PATCH New James Bowes 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use xmalloc in git.c and help.c

---
 git.c  |    2 +-
 help.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
git.c +1 -1
index ed1c65e..5b1bc2a 100644
@@ -99,7 +99,7 @@ static int split_cmdline(char *cmdline, const char ***argv)
 	int src, dst, count = 0, size = 16;
 	char quoted = 0;
 
-	*argv = malloc(sizeof(char*) * size);
+	*argv = xmalloc(sizeof(char*) * size);
 
 	/* split alias_string */
 	(*argv)[count++] = cmdline;
help.c +1 -1
index 0893fea..be8651a 100644
@@ -58,7 +58,7 @@ static void add_cmdname(const char *name, int len)
 		if (!cmdname)
 			oom();
 	}
-	ent = malloc(sizeof(*ent) + len);
+	ent = xmalloc(sizeof(*ent) + len);
 	if (!ent)
 		oom();
 	ent->len = len;
Signature · 1 line
1.5.0.5