Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDotan Barak <dotanba@gmail.com>2008-09-09 22:57:10 +0400
committerJunio C Hamano <gitster@pobox.com>2008-09-10 03:28:05 +0400
commite8eec71d6e79c176d34dc8fda8780ed4dee447a2 (patch)
tree67faf2bc865ed17e29ab2ad042a526bc6383a7e3 /builtin-http-fetch.c
parent4886b89f8fde57b76738c96761eecbfbd0b13112 (diff)
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 <dotanba@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-http-fetch.c')
-rw-r--r--builtin-http-fetch.c2
1 files changed, 1 insertions, 1 deletions
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;