summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorDotan Barak <dotanba@gmail.com>2008-09-09 18:57:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-09-09 23:28:05 (GMT)
commite8eec71d6e79c176d34dc8fda8780ed4dee447a2 (patch)
tree67faf2bc865ed17e29ab2ad042a526bc6383a7e3 /http-push.c
parent4886b89f8fde57b76738c96761eecbfbd0b13112 (diff)
downloadgit-e8eec71d6e79c176d34dc8fda8780ed4dee447a2.zip
git-e8eec71d6e79c176d34dc8fda8780ed4dee447a2.tar.gz
git-e8eec71d6e79c176d34dc8fda8780ed4dee447a2.tar.bz2
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 'http-push.c')
-rw-r--r--http-push.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http-push.c b/http-push.c
index 6805288..c9dd9a1 100644
--- a/http-push.c
+++ b/http-push.c
@@ -2237,7 +2237,7 @@ int main(int argc, char **argv)
no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
if (remote->url && remote->url[strlen(remote->url)-1] != '/') {
- rewritten_url = malloc(strlen(remote->url)+2);
+ rewritten_url = xmalloc(strlen(remote->url)+2);
strcpy(rewritten_url, remote->url);
strcat(rewritten_url, "/");
remote->url = rewritten_url;