From: Sergey Vlasov Date: Mon, 8 Aug 2005 18:46:58 +0000 (+0400) Subject: [PATCH] Plug memory leak in git-pack-objects X-Git-Tag: v0.99.4~5^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=adee7bdf504120055b0f36b4918bdd3e6156912b;p=git.git [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 Signed-off-by: Junio C Hamano --- diff --git a/pack-objects.c b/pack-objects.c index ed24a333..3d622787 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -382,6 +382,10 @@ static void find_deltas(struct object_entry **list, int window, int depth) if (idx >= window) idx = 0; } + + for (i = 0; i < window; ++i) + free(array[i].data); + free(array); } int main(int argc, char **argv)