Skip to content

Commit adee7bd

Browse files
sigprofJunio C Hamano
authored andcommitted
[PATCH] Plug memory leak in git-pack-objects
find_deltas() should free its temporary objects before returning. [jc: Sergey, if you have [PATCH] title on the Subject line of your e-mail, please do not repeat it on the first line in your message body. Thanks.] Signed-off-by: Sergey Vlasov <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7bf058f commit adee7bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pack-objects.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ static void find_deltas(struct object_entry **list, int window, int depth)
382382
if (idx >= window)
383383
idx = 0;
384384
}
385+
386+
for (i = 0; i < window; ++i)
387+
free(array[i].data);
388+
free(array);
385389
}
386390

387391
int main(int argc, char **argv)

0 commit comments

Comments
 (0)