From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org, Phil Sutter <psutter@redhat.com>,
Arturo Borrero <arturo.borrero.glez@gmail.com>
Subject: Re: [libnftnl PATCH] utils: Don't return directly from SNPRINTF_BUFFER_SIZE
Date: Fri, 12 Aug 2016 15:37:11 +0200 [thread overview]
Message-ID: <20160812133711.GA2036@salvia> (raw)
In-Reply-To: <1471005590-18276-1-git-send-email-phil@nwl.cc>
On Fri, Aug 12, 2016 at 02:39:50PM +0200, Phil Sutter wrote:
> From: Phil Sutter <psutter@redhat.com>
>
> Apart from being a bad idea in general, the return statement contained
> in that macro in some cases leads to returning from functions without
> properly cleaning up, thereby causing memory leaks.
>
> Instead, just sanitize the value in 'ret' to not harm further calls of
> snprintf() (as 'len' will eventually just become zero).
Applied, thanks.
prev parent reply other threads:[~2016-08-12 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 12:39 [libnftnl PATCH] utils: Don't return directly from SNPRINTF_BUFFER_SIZE Phil Sutter
2016-08-12 13:37 ` Pablo Neira Ayuso [this message]
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=20160812133711.GA2036@salvia \
--to=pablo@netfilter.org \
--cc=arturo.borrero.glez@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
--cc=psutter@redhat.com \
/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).