Subject: Fix another file leak

From: Chris Wilson <[email-masked]>
Date: Thu, 6 Oct 2011 21:41:37 -0400

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