[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220215144901.1ba007a1@hermes.local>
Date: Tue, 15 Feb 2022 14:49:01 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Maxim Petrov <mmrmaximuzz@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] lnstat: fix strdup leak in -w argument parsing
On Tue, 15 Feb 2022 23:53:47 +0300
Maxim Petrov <mmrmaximuzz@...il.com> wrote:
> 'tmp' string is used for safe tokenizing, but it is not required after
> getting all the widths in -w option. As 'tmp' string is obtained by strdup
> call, the caller has to deallocate it to avoid memory leak.
>
> Signed-off-by: Maxim Petrov <mmrmaximuzz@...il.com>
Would strdupa() be cleaner/simpler. I have no strong preference.
Powered by blists - more mailing lists