Fixed a leak in read-tree

unpack_tree() would not free the tree object it has read.
This commit is contained in:
Petr Baudis 2005-05-11 23:16:23 +02:00 committed by Petr Baudis
parent c599caca3a
commit 1424246481

View File

@ -11,11 +11,14 @@ static int unpack_tree(unsigned char *sha1)
{ {
void *buffer; void *buffer;
unsigned long size; unsigned long size;
int ret;
buffer = read_object_with_reference(sha1, "tree", &size, 0); buffer = read_object_with_reference(sha1, "tree", &size, 0);
if (!buffer) if (!buffer)
return -1; return -1;
return read_tree(buffer, size, stage); ret = read_tree(buffer, size, stage);
free(buffer);
return ret;
} }
static char *lockfile_name; static char *lockfile_name;