projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8871e8
)
[PATCH] fix for memory leak in write-tree.c
author
Brad Roberts
<braddr@puremagic.com>
Sun, 17 Apr 2005 17:55:12 +0000
(10:55 -0700)
committer
Linus Torvalds
<torvalds@ppc970.osdl.org>
Sun, 17 Apr 2005 17:55:12 +0000
(10:55 -0700)
Fix a memory leak in write-tree.c, not freeing the directory buffer.
write-tree.c
patch
|
blob
|
history
diff --git
a/write-tree.c
b/write-tree.c
index
b58871c
..
827809d
100644
(file)
--- a/
write-tree.c
+++ b/
write-tree.c
@@
-93,10
+93,8
@@
static int write_tree(struct cache_entry **cachep, int maxentries, const char *b
i -= 5;
memcpy(buffer+i, "tree ", 5);
- buffer += i;
- offset -= i;
-
- write_sha1_file(buffer, offset, returnsha1);
+ write_sha1_file(buffer + i, offset - i, returnsha1);
+ free(buffer);
return nr;
}