netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: Phil Sutter <phil@nwl.cc>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nft 3/4] all: add free_const() and use it instead of xfree()
Date: Thu, 21 Sep 2023 11:08:20 +0200	[thread overview]
Message-ID: <4adc5da36ee141a73a0131c02fcc652f235c144b.camel@redhat.com> (raw)
In-Reply-To: <ZQt3Gm5HWLKkOEB5@orbyte.nwl.cc>

On Thu, 2023-09-21 at 00:50 +0200, Phil Sutter wrote:
> On Wed, Sep 20, 2023 at 09:48:40PM +0200, Thomas Haller wrote:
> > 
> > datatype_free() in the patch uses+requires free_const() twice:
> > 
> > »·······free_const(dtype->name);
> > »·······free_const(dtype->desc);
> > »·······free(dtype);
> 
> Ah, I see. The only reason why these are allocated is
> concat_type_alloc(), BTW. If it didn't exist, dtype_clone() could
> just
> copy the pointers and datatype_free() would ignore them.


Good point. It's easy to avoid cloning the strings for some particular
cases. Patch will follow.

Thomas


  reply	other threads:[~2023-09-21 20:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 13:13 [PATCH nft 0/4] remove xfree() and add free_const()+nft_gmp_free() Thomas Haller
2023-09-20 13:13 ` [PATCH nft 1/4] datatype: don't return a const string from cgroupv2_get_path() Thomas Haller
2023-09-20 13:13 ` [PATCH nft 2/4] gmputil: add nft_gmp_free() to free strings from mpz_get_str() Thomas Haller
2023-09-20 14:05   ` Phil Sutter
2023-09-20 14:46     ` Thomas Haller
2023-09-20 16:04       ` Phil Sutter
2023-09-20 13:13 ` [PATCH nft 3/4] all: add free_const() and use it instead of xfree() Thomas Haller
2023-09-20 14:13   ` Phil Sutter
2023-09-20 16:06     ` Pablo Neira Ayuso
2023-09-20 16:49       ` Phil Sutter
2023-09-20 16:52         ` Pablo Neira Ayuso
2023-09-20 18:03         ` Thomas Haller
2023-09-20 18:22           ` Phil Sutter
2023-09-20 19:48             ` Thomas Haller
2023-09-20 22:50               ` Phil Sutter
2023-09-21  9:08                 ` Thomas Haller [this message]
2023-09-20 13:13 ` [PATCH nft 4/4] all: remove xfree() and use plain free() Thomas Haller

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=4adc5da36ee141a73a0131c02fcc652f235c144b.camel@redhat.com \
    --to=thaller@redhat.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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).