Code

write-cache: do not leak the serialized cache-tree data.
authorLinus Torvalds <torvalds@osdl.org>
Thu, 11 Jan 2007 20:25:16 +0000 (12:25 -0800)
committerJunio C Hamano <junkio@cox.net>
Thu, 11 Jan 2007 20:25:16 +0000 (12:25 -0800)
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>
read-cache.c

index 8ecd826e9c628346365cfd8c913c7a20af0fc76e..c54a61187711087b98138b9598db6353457e4df3 100644 (file)
@@ -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;