Skip to content

Commit 09ae9ac

Browse files
rctaygitster
authored andcommitted
http-walker: cleanup more thoroughly
Signed-off-by: Tay Ray Chuan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b5e5998 commit 09ae9ac

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

http-walker.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,23 @@ static int fetch_ref(struct walker *walker, struct ref *ref)
543543

544544
static void cleanup(struct walker *walker)
545545
{
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+
546563
http_cleanup();
547564
}
548565

0 commit comments

Comments
 (0)