diff options
author | Ingo Molnar <mingo@elte.hu> | 2005-04-14 14:35:27 +0400 |
---|---|---|
committer | Petr Baudis <xpasky@machine.sinus.cz> | 2005-05-12 01:05:47 +0400 |
commit | aceedfe32e766b169d480c0ec24777d1b09bb118 (patch) | |
tree | 237f72047e142a6f67f77d5b1ca29c121b8d84ed | |
parent | 06cd3b94b27c285fc9877e7c6d9e1f35fbc0a7a4 (diff) |
[patch] git: fix memory leak #2 in checkout-cache.c
this patch fixes another (very rare) memory leak in checkout-cache.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Petr Baudis <pasky@ucw.cz>
-rw-r--r-- | checkout-cache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/checkout-cache.c b/checkout-cache.c index 64ce92147f..b561ef487e 100644 --- a/checkout-cache.c +++ b/checkout-cache.c @@ -77,6 +77,8 @@ static int write_entry(struct cache_entry *ce, const char *path) 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)", path, sha1_to_hex(ce->sha1)); } |