[patch] git: fix memory leak #2 in read-cache.c
- From
- Ingo Molnar <mingo@elte.hu>
- Date
- Apr 14, 2005, 12:39 UTC
- Message-ID
- <20050414123934.GA15420@elte.hu>
- In-Reply-To
- <20050414123258.GA15148@elte.hu>
this patch fixes a memory leak in read-cache.c: when there's cache entry collision we should free the previous one.
Ingo
Signed-off-by: Ingo Molnar <mingo@elte.hu>
--- read-cache.c.orig +++ read-cache.c
@@ -369,6 +369,7 @@ int add_cache_entry(struct cache_entry * /* existing match? Just replace it */ if (pos >= 0) { + free(active_cache[pos]); active_cache[pos] = ce; return 0; }