diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-07-05 11:04:45 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-07-05 11:04:45 +0200 |
commit | 7519dee356a0ab21c8990e59ed05dd48a4e573a0 (patch) | |
tree | fbca3414c84608617229361f0e5eaa0f6a27749a /malloc/malloc-check.c | |
parent | ef0700004bf0dccf493a5e8e21f71d9e7972ea9f (diff) | |
download | glibc-7519dee356a0ab21c8990e59ed05dd48a4e573a0.tar glibc-7519dee356a0ab21c8990e59ed05dd48a4e573a0.tar.gz glibc-7519dee356a0ab21c8990e59ed05dd48a4e573a0.tar.bz2 glibc-7519dee356a0ab21c8990e59ed05dd48a4e573a0.zip |
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>
Diffstat (limited to 'malloc/malloc-check.c')
-rw-r--r-- | malloc/malloc-check.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/malloc/malloc-check.c b/malloc/malloc-check.c index 0299fe99a7..3368532adf 100644 --- a/malloc/malloc-check.c +++ b/malloc/malloc-check.c @@ -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; |