bug#19578: Memory leaks in coreutils/lib/locale_charset.c
From:
Pádraig Brady
Subject:
bug#19578: Memory leaks in coreutils/lib/locale_charset.c
Date:
Tue, 13 Jan 2015 10:07:16 +0000
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
tag 19578 notabug
close 19578
stop
On 13/01/15 09:35, Daiki Ueno wrote:
> Zhaopeng Li <address@hidden> writes:
>
>> At line 534 of coreutils/lib/locale_charset.c, var ‘aliases' points
>> to a buffer which is allocated using malloc() .
>
>> This buffer is not freed when codeset is still an empty string after
>> the loop (Line 534~542).
>>
>> So it will be leaked under such situation.
>
>> Line 533 /* Resolve alias. */
>> Line 534 for (aliases = get_charset_aliases ();
>
> I got the same error from clang-analyzer, but I think the leak is
> intentional and harmless. The return value of get_charset_aliases is
> saved in a global variable charset_aliases and won't be allocated twice.
Thanks Daiki.
Closing for now.