Browse Source

use xmalloc in git.c and help.c

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
James Bowes 18 years ago committed by Junio C Hamano
parent
commit
3301521a25
  1. 2
      git.c
  2. 2
      help.c

2
git.c

@ -99,7 +99,7 @@ static int split_cmdline(char *cmdline, const char ***argv)
int src, dst, count = 0, size = 16; int src, dst, count = 0, size = 16;
char quoted = 0; char quoted = 0;


*argv = malloc(sizeof(char*) * size); *argv = xmalloc(sizeof(char*) * size);


/* split alias_string */ /* split alias_string */
(*argv)[count++] = cmdline; (*argv)[count++] = cmdline;

2
help.c

@ -58,7 +58,7 @@ static void add_cmdname(const char *name, int len)
if (!cmdname) if (!cmdname)
oom(); oom();
} }
ent = malloc(sizeof(*ent) + len); ent = xmalloc(sizeof(*ent) + len);
if (!ent) if (!ent)
oom(); oom();
ent->len = len; ent->len = len;

Loading…
Cancel
Save