[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5ff8631c-1c57-9bc7-4da8-ae089a7c74a6@gmail.com>
Date: Wed, 16 Feb 2022 22:40:58 +0300
From: Maxim Petrov <mmrmaximuzz@...il.com>
To: stephen@...workplumber.org
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] lnstat: fix strdup leak in -w argument parsing
On 2022-02-15 22:49 UTC, Stephen Hemminger wrote:
> Would strdupa() be cleaner/simpler.
strdupa will not free the allocated memory until the caller returns. In our
case the caller is 'main', so despite valgrind will be happy, the memory
will be wasted anyway.
However, I guess that the option is mostly used just like '-w 20', so the
_wasted anyway_ strdupa memory is only about a few bytes in these cases,
and from this perspective I also have no strong preference. But I don't
know how this option is used by others.
Powered by blists - more mailing lists