From: Junio C Hamano Date: Mon, 14 Sep 2009 21:48:15 +0000 (-0700) Subject: http.c: avoid freeing an uninitialized pointer X-Git-Tag: v1.6.4.4~5^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b2025146d0718d953036352f8435cfa392b1d799;p=git.git 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 --- diff --git a/http.c b/http.c index d0cc1b334..15926d8d6 100644 --- a/http.c +++ b/http.c @@ -866,7 +866,7 @@ static int fetch_pack_index(unsigned char *sha1, const char *base_url) int ret = 0; char *hex = xstrdup(sha1_to_hex(sha1)); char *filename; - char *url; + char *url = NULL; struct strbuf buf = STRBUF_INIT; if (has_pack_index(sha1)) {