From: Chris Wilson <cwilson@vigilantsw.com>
To: git@vger.kernel.org
Subject: Fix another file leak
Date: Thu, 6 Oct 2011 21:41:37 -0400 [thread overview]
Message-ID: <20111007014136.GB10839@localhost> (raw)
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
next reply other threads:[~2011-10-07 1:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 1:41 Chris Wilson [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111007014136.GB10839@localhost \
--to=cwilson@vigilantsw.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).