[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <13a9a6b9-fade-7fd0-fb6d-eff13b363a32@gmail.com>
Date: Mon, 5 Feb 2018 09:25:42 -0700
From: David Ahern <dsahern@...il.com>
To: Serhey Popovych <serhe.popovych@...il.com>
Cc: netdev <netdev@...r.kernel.org>,
Maciej Żenczykowski <maze@...gle.com>
Subject: Re: [BUG iproute2] ip tuntap show
On 2/5/18 8:34 AM, Serhey Popovych wrote:
> Sorry David, but I do no see problem with this function right now:
>
> 1. It allocates string using malloc() in asprintf()
> 2. free() it *after* fopen() to prevent memory leak if fopen() fails
> 3. or if fopen() succeeded and we fscanf() with %ms that will allcate
> buffer we return.
>
> I agree this is GNU extensions, but it does not look as user after free
> to me. Should I get rid of these extensions? They are not last as I can
> find.
>
ok, I missed the 'm' in the %ms of the fscanf. Thanks for checking.
Powered by blists - more mailing lists