summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2007-01-11 20:25:16 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-11 20:25:16 (GMT)
commit2cdf9509df66358f83a577caf83dc06e3161ec3c (patch)
tree2b6a8aebd67386fa7ce7425c9eeee4dfc23bde16 /read-cache.c
parent2a3a3c247e7f1f257e9c6762e48b98f08a30011a (diff)
downloadgit-2cdf9509df66358f83a577caf83dc06e3161ec3c.zip
git-2cdf9509df66358f83a577caf83dc06e3161ec3c.tar.gz
git-2cdf9509df66358f83a577caf83dc06e3161ec3c.tar.bz2
write-cache: do not leak the serialized cache-tree data.
It is not used after getting written, and just is leaking every time we write the index out. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 8ecd826..c54a611 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1010,7 +1010,7 @@ int write_cache(int newfd, struct cache_entry **cache, int entries)
if (data &&
!write_index_ext_header(&c, newfd, CACHE_EXT_TREE, sz) &&
!ce_write(&c, newfd, data, sz))
- ;
+ free(data);
else {
free(data);
return -1;