projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c599cac
)
Fixed a leak in read-tree
author
Petr Baudis
<pasky@ucw.cz>
Wed, 11 May 2005 21:16:23 +0000
(23:16 +0200)
committer
Petr Baudis
<xpasky@machine.sinus.cz>
Wed, 11 May 2005 21:16:23 +0000
(23:16 +0200)
unpack_tree() would not free the tree object it has read.
read-tree.c
patch
|
blob
|
history
diff --git
a/read-tree.c
b/read-tree.c
index f8dc509a1f999fcbcccc6936477ddc80c9d063cc..f6298e5c2178ee8e5f898ea769ae7108d1a7cfbd 100644
(file)
--- 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;