Browse Source

[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>
maint
Ingo Molnar 20 years ago committed by Petr Baudis
parent
commit
aceedfe32e
  1. 2
      checkout-cache.c

2
checkout-cache.c

@ -77,6 +77,8 @@ static int write_entry(struct cache_entry *ce, const char *path) @@ -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));
}

Loading…
Cancel
Save