From: Linus Torvalds Date: Thu, 11 Jan 2007 20:25:16 +0000 (-0800) Subject: write-cache: do not leak the serialized cache-tree data. X-Git-Tag: v1.5.0-rc1~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2cdf9509df66358f83a577caf83dc06e3161ec3c;p=git.git 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 --- diff --git a/read-cache.c b/read-cache.c index 8ecd826e9..c54a61187 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;