Fix another file leak
- From
- Chris Wilson <cwilson@vigilantsw.com>
- Date
- Oct 7, 2011, 01:41 UTC
- Message-ID
- <20111007014136.GB10839@localhost>
Hi,
Vigilant Sentry (our C/C++ static analysis tool) found that commit 6d4bb383, added a file leak to builtin/fetch.c.
static int store_updated_refs(...
{
FILE *fp;
...
fp = fopen(filename, "a");
if (!fp)
return error(_("cannot open %s: %s\n"), filename, strerror(errno));
.... if (check_everything_connected(iterate_ref_map, 0, &rm))
return error(_("%s did not send all necessary objects\n"), url);Please close the file handle before returning from the function.
Thanks, Chris
-- Chris Wilson http://vigilantsw.com/ Vigilant Software, LLC