1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-26 02:26:11 +02:00

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
This commit is contained in:
Junio C Hamano 2011-08-11 11:03:13 -07:00
commit 0e9b12f874
2 changed files with 5 additions and 9 deletions

View File

@ -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.

8
http.c
View File

@ -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;