From 812666c8e66a21e668c0789d0422aa5a7db54961 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Tue, 26 Apr 2005 12:00:58 -0700 Subject: [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 Signed-off-by: Linus Torvalds --- http-pull.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'http-pull.c') diff --git a/http-pull.c b/http-pull.c index a17225719c..192dcc370d 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/"); -- cgit v1.2.1