aboutsummaryrefslogtreecommitdiff
path: root/http-pull.c
diff options
context:
space:
mode:
authorChristopher Li <git@chrisli.org>2005-04-26 12:00:58 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-26 12:00:58 -0700
commit812666c8e66a21e668c0789d0422aa5a7db54961 (patch)
treeb98a096f4b3c70aac3110f905a1367c23b402cca /http-pull.c
parentf2a19340ada1188e278d5b198d3466ed7411e2d4 (diff)
downloadgit-812666c8e66a21e668c0789d0422aa5a7db54961.tar.gz
git-812666c8e66a21e668c0789d0422aa5a7db54961.tar.xz
[PATCH] introduce xmalloc and xrealloc
Introduce xmalloc and xrealloc to die gracefully with a descriptive message when out of memory, rather than taking a SIGSEGV. Signed-off-by: Christopher Li<chrislgit@chrisli.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'http-pull.c')
-rw-r--r--http-pull.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http-pull.c b/http-pull.c
index a17225719..192dcc370 100644
--- a/http-pull.c
+++ b/http-pull.c
@@ -73,7 +73,7 @@ static int fetch(unsigned char *sha1)
curl_easy_setopt(curl, CURLOPT_FILE, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite_sha1_file);
- url = malloc(strlen(base) + 50);
+ url = xmalloc(strlen(base) + 50);
strcpy(url, base);
posn = url + strlen(base);
strcpy(posn, "objects/");