1
0
mirror of https://github.com/git/git.git synced 2024-11-20 06:24:00 +01:00

http.c: avoid freeing an uninitialized pointer

An earlier 59b8d38 (http.c: remove verification of remote packs) left
the variable "url" uninitialized; "goto cleanup" codepath can free it
which is not very nice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2009-09-14 14:48:15 -07:00
parent 59b8d38f6e
commit b2025146d0

2
http.c

@ -866,7 +866,7 @@ static int fetch_pack_index(unsigned char *sha1, const char *base_url)
int ret = 0; int ret = 0;
char *hex = xstrdup(sha1_to_hex(sha1)); char *hex = xstrdup(sha1_to_hex(sha1));
char *filename; char *filename;
char *url; char *url = NULL;
struct strbuf buf = STRBUF_INIT; struct strbuf buf = STRBUF_INIT;
if (has_pack_index(sha1)) { if (has_pack_index(sha1)) {