Re: [PATCH 4/5] lib: avoid double free in loopdev.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 April 2016 at 23:52, Yuriy M. Kaminskiy <yumkam@xxxxxxxxx> wrote:
> Sami Kerola <kerolasa@xxxxxx> writes:
>
>> Found with scan-build.
>>
>> Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
>> ---
>>  lib/loopdev.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/loopdev.c b/lib/loopdev.c
>> index 9ae61da..ca5d2f4 100644
>> --- a/lib/loopdev.c
>> +++ b/lib/loopdev.c
>> @@ -460,6 +460,7 @@ static int loop_scandir(const char *dirname, int **ary, int hasprefix)
>>                       tmp = realloc(*ary, arylen * sizeof(int));
>>                       if (!tmp) {
>>                               free(*ary);
>> +                             ary = NULL;
>
> This cannot have any effect. Probably you wanted
>                                 *ary = NULL;

Thank you for review Yuriy. Fixed in

https://github.com/kerolasa/lelux-utiliteetit/commit/34f6177a24cf602d0720b82f2064e6830ba34ffb

-- 
Sami Kerola
http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux