summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJonas Fonseca <fonseca@diku.dk>2006-08-26 16:16:18 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-26 17:54:06 -0700
commit83572c1a914d3f7a8dd66d954c11bbc665b7b923 (patch)
treebae4dc57d36b83c835253498dfdabd29d4dec66e /git.c
parent095c424d08d96a5f9ee3ca53ae952e92c5cff99b (diff)
downloadgit-83572c1a914d3f7a8dd66d954c11bbc665b7b923.tar.gz
Use xrealloc instead of realloc
Change places that use realloc, without a proper error path, to instead use xrealloc. Drop an erroneous error path in the daemon code that used errno in the die message in favour of the simpler xrealloc. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git.c')
-rw-r--r--git.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/git.c b/git.c
index a01d195c23..3adf262c41 100644
--- a/git.c
+++ b/git.c
@@ -120,7 +120,7 @@ static int split_cmdline(char *cmdline, const char ***argv)
; /* skip */
if (count >= size) {
size += 16;
- *argv = realloc(*argv, sizeof(char*) * size);
+ *argv = xrealloc(*argv, sizeof(char*) * size);
}
(*argv)[count++] = cmdline + dst;
} else if(!quoted && (c == '\'' || c == '"')) {
@@ -191,8 +191,8 @@ static int handle_alias(int *argcp, const char ***argv)
fflush(stderr);
}
- new_argv = realloc(new_argv, sizeof(char*) *
- (count + *argcp + 1));
+ new_argv = xrealloc(new_argv, sizeof(char*) *
+ (count + *argcp + 1));
/* insert after command name */
memcpy(new_argv + count, *argv + 1, sizeof(char*) * *argcp);
new_argv[count+*argcp] = NULL;