aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bowes <jbowes@dangerouslyinc.com>2007-03-27 18:30:08 -0400
committerJunio C Hamano <junkio@cox.net>2007-03-27 16:57:57 -0700
commitc6e0caa3846f05831c1d4785ef373820c75eba2b (patch)
tree55773b17a3e762baa795c98ad7afc7479a658913
parentaa4cfa8516f33ccde36b6cadf3dab2ddefb972af (diff)
downloadgit-c6e0caa3846f05831c1d4785ef373820c75eba2b.tar.gz
git-c6e0caa3846f05831c1d4785ef373820c75eba2b.tar.xz
use xrealloc in help.c
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--help.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/help.c b/help.c
index be8651a73..6a9af4d17 100644
--- a/help.c
+++ b/help.c
@@ -31,12 +31,6 @@ static int term_columns(void)
return 80;
}
-static void oom(void)
-{
- fprintf(stderr, "git: out of memory\n");
- exit(1);
-}
-
static inline void mput_char(char c, unsigned int num)
{
while(num--)
@@ -54,13 +48,9 @@ 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));
- if (!cmdname)
- oom();
+ cmdname = xrealloc(cmdname, cmdname_alloc * sizeof(*cmdname));
}
ent = xmalloc(sizeof(*ent) + len);
- if (!ent)
- oom();
ent->len = len;
memcpy(ent->name, name, len);
ent->name[len] = 0;