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>
Junio C Hamano committed
Sep 14, 2009 at 14:48 UTC
b2025146d0718d953036352f8435cfa392b1d799
1 file changed
+1
-1
http.c
+1
-1
@@ -866,7 +866,7 @@ static int fetch_pack_index(unsigned char *sha1, const char *base_url)
866
int ret = 0;
867
char *hex = xstrdup(sha1_to_hex(sha1));
868
char *filename;
869
- char *url;
869
+ char *url = NULL;
870
struct strbuf buf = STRBUF_INIT;
871
872
if (has_pack_index(sha1)) {