From: Ingo Molnar Date: Thu, 14 Apr 2005 11:35:27 GMT Subject: [patch] git: fix memory leak #2 in checkout-cache.c Message-ID: <20050414113527.GA13790@elte.hu> In-Reply-To: <20050414112638.GA12593@elte.hu> this patch fixes another (very rare) memory leak in checkout-cache. Ingo Signed-off-by: Ingo Molnar --- checkout-cache.c.orig +++ checkout-cache.c @@ -74,6 +74,8 @@ static int write_entry(struct cache_entr new = read_sha1_file(ce->sha1, type, &size); if (!new || strcmp(type, "blob")) { + if (new) + free(new); return error("checkout-cache: unable to read sha1 file of %s (%s)", ce->name, sha1_to_hex(ce->sha1)); }