summaryrefslogtreecommitdiff
path: root/pack-objects.c
diff options
context:
space:
mode:
authorSergey Vlasov <vsu@altlinux.ru>2005-08-08 22:46:58 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-08 22:51:46 -0700
commitadee7bdf504120055b0f36b4918bdd3e6156912b (patch)
tree77cd38f40934b4d7e07660ed08f6ad7606bdd37c /pack-objects.c
parent7bf058f0082d17b25b343782e3a33779cc7c956d (diff)
downloadgit-adee7bdf504120055b0f36b4918bdd3e6156912b.tar.gz
[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 <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pack-objects.c b/pack-objects.c
index ed24a33300..3d622787cc 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)