1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

malloc: Simplify checked_request2size interface

In-band signaling avoids an uninitialized variable warning when
building with -Og and GCC 12.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Florian Weimer
2022-07-05 11:04:45 +02:00
parent ef0700004b
commit 7519dee356
2 changed files with 18 additions and 15 deletions

View File

@ -275,7 +275,8 @@ realloc_check (void *oldmem, size_t bytes)
malloc_printerr ("realloc(): invalid pointer");
const INTERNAL_SIZE_T oldsize = chunksize (oldp);
if (!checked_request2size (rb, &chnb))
chnb = checked_request2size (rb);
if (chnb == 0)
{
__set_errno (ENOMEM);
goto invert;