[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231116150521.66a8ea69@hermes.local>
Date: Thu, 16 Nov 2023 15:05:21 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: heminhong <heminhong@...inos.cn>
Cc: petrm@...dia.com, netdev@...r.kernel.org
Subject: Re: [PATCH v4] iproute2: prevent memory leak
On Thu, 16 Nov 2023 11:13:08 +0800
heminhong <heminhong@...inos.cn> wrote:
> When the return value of rtnl_talk() is not less than 0,
> 'answer' will be allocated. The 'answer' should be free
> after using, otherwise it will cause memory leak.
>
> Signed-off-by: heminhong <heminhong@...inos.cn>
I am skeptical, what is the code path through rtn_talk() that
returns non zero, and allocates answer. If so, that should be fixed
there.
In current code, the returns are:
- sendmsg() fails
- recvmsg() fails
- truncated message
The paths that set answer are returning 0
Powered by blists - more mailing lists