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
Родитель 5fb249aec7 d24d905509
Коммит 0e9b12f874
2 изменённых файлов: 5 добавлений и 9 удалений

Просмотреть файл

@ -30,15 +30,15 @@ all::
# Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in # Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in
# /foo/bar/include and /foo/bar/lib directories. # /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:// # 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 # Define CURLDIR=/foo/bar if your curl header and library files are in
# /foo/bar/include and /foo/bar/lib directories. # /foo/bar/include and /foo/bar/lib directories.
# #
# Define NO_EXPAT if you do not have expat installed. git-http-push is # 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 # Define EXPATDIR=/foo/bar if your expat header and library files are in
# /foo/bar/include and /foo/bar/lib directories. # /foo/bar/include and /foo/bar/lib directories.

8
http.c
Просмотреть файл

@ -1121,9 +1121,8 @@ struct http_pack_request *new_http_pack_request(
struct strbuf buf = STRBUF_INIT; struct strbuf buf = STRBUF_INIT;
struct http_pack_request *preq; struct http_pack_request *preq;
preq = xmalloc(sizeof(*preq)); preq = xcalloc(1, sizeof(*preq));
preq->target = target; preq->target = target;
preq->range_header = NULL;
end_url_with_slash(&buf, base_url); end_url_with_slash(&buf, base_url);
strbuf_addf(&buf, "objects/pack/pack-%s.pack", 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 curl_slist *range_header = NULL;
struct http_object_request *freq; struct http_object_request *freq;
freq = xmalloc(sizeof(*freq)); freq = xcalloc(1, sizeof(*freq));
hashcpy(freq->sha1, sha1); hashcpy(freq->sha1, sha1);
freq->localfile = -1; freq->localfile = -1;
@ -1253,8 +1252,6 @@ struct http_object_request *new_http_object_request(const char *base_url,
goto abort; goto abort;
} }
memset(&freq->stream, 0, sizeof(freq->stream));
git_inflate_init(&freq->stream); git_inflate_init(&freq->stream);
git_SHA1_Init(&freq->c); git_SHA1_Init(&freq->c);
@ -1329,7 +1326,6 @@ struct http_object_request *new_http_object_request(const char *base_url,
return freq; return freq;
abort: abort:
free(filename);
free(freq->url); free(freq->url);
free(freq); free(freq);
return NULL; return NULL;