lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 14 Nov 2023 19:33:50 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: heminhong <heminhong@...inos.cn>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v2] iproute2: prevent memory leak

On Wed, 15 Nov 2023 10:37:03 +0800
heminhong <heminhong@...inos.cn> wrote:

> When the return value of rtnl_talk() is less than 0, 'answer' does not
> need to release. When the return value of rtnl_talk() is greater than
> or equal to 0, 'answer' will be allocated, if subsequent processing fails,
> the memory should be free, otherwise it will cause memory leak.
> 
> Signed-off-by: heminhong <heminhong@...inos.cn>

No null check needed before free().

   free()
       The  free()  function  frees  the memory space pointed to by ptr, which
       must have been returned by a previous call to malloc() or related func‐
       tions.  Otherwise, or if ptr has already been freed, undefined behavior
       occurs.  If ptr is NULL, no operation is performed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ