summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb891a5)
raw | patch | inline | side by side (parent: cb891a5)
author | Mike Hommey <mh@glandium.org> | |
Fri, 14 Dec 2007 21:18:00 +0000 (22:18 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 15 Dec 2007 05:31:58 +0000 (21:31 -0800) |
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index fffbe9ccb42e305d898a25a126918db0883b11cb..fc60bfd5f476abc94c3f70b5ea95373bd444e16f 100644 (file)
--- a/http-push.c
+++ b/http-push.c
hex);
}
} else {
+ free(url);
return error("Unable to start request");
}
- if (has_pack_index(sha1))
+ if (has_pack_index(sha1)) {
+ free(url);
return 0;
+ }
if (push_verbosely)
fprintf(stderr, "Getting index for pack %s\n", hex);
filename = sha1_pack_index_name(sha1);
snprintf(tmpfile, sizeof(tmpfile), "%s.temp", filename);
indexfile = fopen(tmpfile, "a");
- if (!indexfile)
+ if (!indexfile) {
+ free(url);
return error("Unable to open local file %s for pack index",
tmpfile);
+ }
slot = get_active_slot();
slot->results = &results;
curl_easy_setopt(slot->curl, CURLOPT_URL, url);
if (start_active_slot(slot)) {
run_active_slot(slot);
+ free(url);
if (results.curl_result != CURLE_OK)
return error("Couldn't get %s for %s\n%s",
url, ref, curl_errorstr);
} else {
+ free(url);
return error("Unable to start request");
}
if (start_active_slot(slot)) {
run_active_slot(slot);
+ free(url);
if (results.http_code == 404)
return 0;
else if (results.curl_result == CURLE_OK)
else
fprintf(stderr, "HEAD HTTP error %ld\n", results.http_code);
} else {
+ free(url);
fprintf(stderr, "Unable to start HEAD request\n");
}