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]
Message-ID: <20220201102712.1390ae4d@hermes.local>
Date:   Tue, 1 Feb 2022 10:27:12 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Andrea Claudi <aclaudi@...hat.com>
Cc:     netdev@...r.kernel.org, dsahern@...il.com, markzhang@...dia.com,
        leonro@...dia.com
Subject: Re: [PATCH iproute2 1/3] lib/fs: fix memory leak in get_task_name()

On Tue,  1 Feb 2022 18:39:24 +0100
Andrea Claudi <aclaudi@...hat.com> wrote:

> +	if (fscanf(f, "%ms\n", &comm) != 1) {
> +		free(comm);
> +		return NULL;

This is still leaking the original comm.

Why not change it to use a local variable for the path
(avoid asprintf) and not reuse comm for both pathname
and return value.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ