Skip to content

Commit

Permalink
use xmalloc in git.c and help.c
Browse files Browse the repository at this point in the history
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
James Bowes authored and Junio C Hamano committed Mar 26, 2007
1 parent 3a81b9f commit 3301521
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion help.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3301521

Please sign in to comment.