From e8eec71d6e79c176d34dc8fda8780ed4dee447a2 Mon Sep 17 00:00:00 2001 From: Dotan Barak Date: Tue, 9 Sep 2008 21:57:10 +0300 Subject: Use xmalloc() and friends to catch allocation failures Some places use the standard malloc/strdup without checking if the allocation was successful; they should use xmalloc/xstrdup that check the memory allocation result. Signed-off-by: Dotan Barak Signed-off-by: Junio C Hamano --- git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git.c') diff --git a/git.c b/git.c index adf7352409..905acc2f2c 100644 --- a/git.c +++ b/git.c @@ -364,7 +364,7 @@ static void handle_internal_command(int argc, const char **argv) if (sizeof(ext) > 1) { i = strlen(argv[0]) - strlen(ext); if (i > 0 && !strcmp(argv[0] + i, ext)) { - char *argv0 = strdup(argv[0]); + char *argv0 = xstrdup(argv[0]); argv[0] = cmd = argv0; argv0[i] = '\0'; } -- cgit v1.3