summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-11 18:03:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-11 18:03:13 (GMT)
commit0e9b12f874955cba820efd786e176be8ba1acc2e (patch)
tree6946d3ebc4adc74c8a26099ff00a9369636f6290
parent5fb249aec763205f8d26370a18c5adb167008dd8 (diff)
parentd24d905509207fb47abe654789e1248a18785dfc (diff)
downloadgit-0e9b12f874955cba820efd786e176be8ba1acc2e.zip
git-0e9b12f874955cba820efd786e176be8ba1acc2e.tar.gz
git-0e9b12f874955cba820efd786e176be8ba1acc2e.tar.bz2
Merge branch 'rc/maint-http-wrong-free'
* rc/maint-http-wrong-free: Makefile: some changes for http-related flag documentation http.c: fix an invalid free() Conflicts: Makefile
-rw-r--r--Makefile6
-rw-r--r--http.c8
2 files changed, 5 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 62ad0c2..8dd782f 100644
--- a/Makefile
+++ b/Makefile
@@ -30,15 +30,15 @@ all::
# Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
-# Define NO_CURL if you do not have libcurl installed. git-http-pull and
+# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
# git-http-push are not built, and you cannot use http:// and https://
-# transports.
+# transports (neither smart nor dumb).
#
# Define CURLDIR=/foo/bar if your curl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define NO_EXPAT if you do not have expat installed. git-http-push is
-# not built, and you cannot push using http:// and https:// transports.
+# not built, and you cannot push using http:// and https:// transports (dumb).
#
# Define EXPATDIR=/foo/bar if your expat header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
diff --git a/http.c b/http.c
index a1ea3db..a59cac4 100644
--- a/http.c
+++ b/http.c
@@ -1121,9 +1121,8 @@ struct http_pack_request *new_http_pack_request(
struct strbuf buf = STRBUF_INIT;
struct http_pack_request *preq;
- preq = xmalloc(sizeof(*preq));
+ preq = xcalloc(1, sizeof(*preq));
preq->target = target;
- preq->range_header = NULL;
end_url_with_slash(&buf, base_url);
strbuf_addf(&buf, "objects/pack/pack-%s.pack",
@@ -1215,7 +1214,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
struct curl_slist *range_header = NULL;
struct http_object_request *freq;
- freq = xmalloc(sizeof(*freq));
+ freq = xcalloc(1, sizeof(*freq));
hashcpy(freq->sha1, sha1);
freq->localfile = -1;
@@ -1253,8 +1252,6 @@ struct http_object_request *new_http_object_request(const char *base_url,
goto abort;
}
- memset(&freq->stream, 0, sizeof(freq->stream));
-
git_inflate_init(&freq->stream);
git_SHA1_Init(&freq->c);
@@ -1329,7 +1326,6 @@ struct http_object_request *new_http_object_request(const char *base_url,
return freq;
abort:
- free(filename);
free(freq->url);
free(freq);
return NULL;