Re: [PATCH nft 3/4] all: add free_const() and use it instead of xfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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.


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux