diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-11 11:03:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-11 11:03:13 -0700 |
commit | 0e9b12f874955cba820efd786e176be8ba1acc2e (patch) | |
tree | 6946d3ebc4adc74c8a26099ff00a9369636f6290 | |
parent | 5fb249aec763205f8d26370a18c5adb167008dd8 (diff) | |
parent | d24d905509207fb47abe654789e1248a18785dfc (diff) | |
download | git-0e9b12f874955cba820efd786e176be8ba1acc2e.tar.gz |
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-- | Makefile | 6 | ||||
-rw-r--r-- | http.c | 8 |
2 files changed, 5 insertions, 9 deletions
@@ -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. @@ -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; |