From: Michael J Gruber <git@drmicha.warpmail.net>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Laszlo Papp <djszapi2@gmail.com>,
git@vger.kernel.org, Laszlo Papp <djszapi@archlinux.us>
Subject: Re: [PATCH] Fix resource leaks in wrapper.c
Date: Tue, 27 Oct 2009 09:26:48 +0100 [thread overview]
Message-ID: <4AE6AEC8.4040800@drmicha.warpmail.net> (raw)
In-Reply-To: <4AE69DA7.6030704@viscovery.net>
Johannes Sixt venit, vidit, dixit 27.10.2009 08:13:
> Laszlo Papp schrieb:
>> @@ -266,7 +266,7 @@ int odb_mkstemp(char *template, size_t limit, const char *pattern)
>> fd = mkstemp(template);
>> if (0 <= fd)
>> return fd;
>> -
>> + close(fd);
>
> Sorry, where is here a resource leak? You are "closing" something that was
> never opened because fd is less than zero.
>
> Ditto for the other case.
I guess it's about silencing some challenged code analysis tool. I
recall that last time we had something like this we decided that coders
are smarter than tools... and also that clean up like this (for real
leaks) would be something for libgit.
Michael
next prev parent reply other threads:[~2009-10-27 8:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-27 3:53 [PATCH] Fix resource leaks in wrapper.c Laszlo Papp
2009-10-27 7:13 ` Johannes Sixt
2009-10-27 8:26 ` Michael J Gruber [this message]
[not found] ` <a362e8010910270335g106024e6if3f016c271ab55d6@mail.gmail.com>
2009-10-27 11:44 ` Michael J Gruber
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=4AE6AEC8.4040800@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=djszapi2@gmail.com \
--cc=djszapi@archlinux.us \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.