http-walker: cleanup more thoroughly
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tay Ray Chuan committed
Mar 2, 2010 at 18:49 UTC
09ae9aca14750f00c9e25fd16cdf60819fb410a8
1 file changed
+17
http-walker.c
+17
@@ -543,6 +543,23 @@ static int fetch_ref(struct walker *walker, struct ref *ref)
543
544
static void cleanup(struct walker *walker)
545
{
546
+ struct walker_data *data = walker->data;
547
+ struct alt_base *alt, *alt_next;
548
+
549
+ if (data) {
550
+ alt = data->alt;
551
+ while (alt) {
552
+ alt_next = alt->next;
553
+
554
+ free(alt->base);
555
+ free(alt);
556
+
557
+ alt = alt_next;
558
+ }
559
+ free(data);
560
+ walker->data = NULL;
561
+ }
562
+
563
http_cleanup();
564
}
565