git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix another file leak
@ 2011-10-07  1:41 Chris Wilson
  2011-10-07  6:13 ` [PATCH] fetch: plug two leaks on error exit in store_updated_refs René Scharfe
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2011-10-07  1:41 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-07  7:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07  1:41 Fix another file leak Chris Wilson
2011-10-07  6:13 ` [PATCH] fetch: plug two leaks on error exit in store_updated_refs René Scharfe
2011-10-07  6:49   ` Tay Ray Chuan
2011-10-07  6:59     ` René Scharfe
2011-10-07  7:40       ` [PATCH v2] " Tay Ray Chuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).