From 14242464811bff9e8d1af8eb33367a01480a18d0 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 11 May 2005 23:16:23 +0200 Subject: [PATCH] Fixed a leak in read-tree unpack_tree() would not free the tree object it has read. --- read-tree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/read-tree.c b/read-tree.c index f8dc509a1..f6298e5c2 100644 --- a/read-tree.c +++ b/read-tree.c @@ -11,11 +11,14 @@ static int unpack_tree(unsigned char *sha1) { void *buffer; unsigned long size; + int ret; buffer = read_object_with_reference(sha1, "tree", &size, 0); if (!buffer) return -1; - return read_tree(buffer, size, stage); + ret = read_tree(buffer, size, stage); + free(buffer); + return ret; } static char *lockfile_name; -- 2.26.2