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 --- builtin-http-fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-http-fetch.c') diff --git a/builtin-http-fetch.c b/builtin-http-fetch.c index 3a062487a7..ea2b689651 100644 --- a/builtin-http-fetch.c +++ b/builtin-http-fetch.c @@ -53,7 +53,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix) } url = argv[arg]; if (url && url[strlen(url)-1] != '/') { - rewritten_url = malloc(strlen(url)+2); + rewritten_url = xmalloc(strlen(url)+2); strcpy(rewritten_url, url); strcat(rewritten_url, "/"); url = rewritten_url; -- cgit v1.2.3