From: Tay Ray Chuan Date: Tue, 2 Mar 2010 10:49:28 +0000 (+0800) Subject: http-walker: cleanup more thoroughly X-Git-Tag: v1.7.1-rc0~65^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=09ae9aca14750f00c9e25fd16cdf60819fb410a8;p=git.git http-walker: cleanup more thoroughly Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- diff --git a/http-walker.c b/http-walker.c index 700bc1311..508e35517 100644 --- a/http-walker.c +++ b/http-walker.c @@ -543,6 +543,23 @@ static int fetch_ref(struct walker *walker, struct ref *ref) static void cleanup(struct walker *walker) { + struct walker_data *data = walker->data; + struct alt_base *alt, *alt_next; + + if (data) { + alt = data->alt; + while (alt) { + alt_next = alt->next; + + free(alt->base); + free(alt); + + alt = alt_next; + } + free(data); + walker->data = NULL; + } + http_cleanup(); }