[PATCH] malloc: Fix -Wuse-after-free warning in tst-mallocalign1 [BZ #26779]
Carlos O'Donell
carlos@redhat.com
Mon Jan 31 06:00:45 GMT 2022
On 1/31/22 00:32, Siddhesh Poyarekar wrote:
> On 31/01/2022 10:51, Carlos O'Donell via Libc-alpha wrote:
>> The test leaks bits from the freed pointer via the return value
>> in ret, and the compiler correctly identifies this issue.
>> We switch the test to use TEST_VERIFY and terminate the test
>> if any of the pointers return an unexpected alignment.
>>
>> This fixes another -Wuse-after-free error when compiling glibc
>> with gcc 12.
>>
>> Tested on x86_64 and i686 without regression.
>
> LGTM.
>
> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
>
Thanks. Pushed. That fixes the last gcc 12 issue I'm seeing on x86 for
the glibc 2.35 release.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list