From 2cdf9509df66358f83a577caf83dc06e3161ec3c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 11 Jan 2007 12:25:16 -0800 Subject: [PATCH] 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 --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2