use xmalloc in git.c and help.c
authorJames Bowes <jbowes@dangerouslyinc.com>
Mon, 26 Mar 2007 00:39:36 +0000 (20:39 -0400)
committerJunio C Hamano <junkio@cox.net>
Mon, 26 Mar 2007 01:00:23 +0000 (18:00 -0700)
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git.c
help.c
diff --git a/git.c b/git.c
index ed1c65e3095fbbbeab88976bbae358a9d76ad937..5b1bc2a895306157649e399d5bad9bb827935318 100644 (file)
--- a/git.c
+++ b/git.c
@@ -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;
diff --git a/help.c b/help.c
index 0893fea0254f4ec8acbce82a0af41e4e61bd72a6..be8651a73977f860a87fb944f6fca52af41a2c28 100644 (file)
--- a/help.c
+++ b/help.c
@@ -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;