git: dbd51c416a80 - main - realloc(9): Move slab and zone under #ifndef DEBUG_REDZONE.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 12 Apr 2022 21:59:35 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=dbd51c416a80ff9953c4bfdb266673628b21303c

commit dbd51c416a80ff9953c4bfdb266673628b21303c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-12 21:58:59 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-12 21:58:59 +0000

    realloc(9): Move slab and zone under #ifndef DEBUG_REDZONE.
---
 sys/kern/kern_malloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 4ecdcdacce01..eb70e4e6cd57 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -986,8 +986,10 @@ zfree(void *addr, struct malloc_type *mtp)
 void *
 realloc(void *addr, size_t size, struct malloc_type *mtp, int flags)
 {
+#ifndef DEBUG_REDZONE
 	uma_zone_t zone;
 	uma_slab_t slab;
+#endif
 	unsigned long alloc;
 	void *newaddr;
 
@@ -1011,8 +1013,6 @@ realloc(void *addr, size_t size, struct malloc_type *mtp, int flags)
 #endif
 
 #ifdef DEBUG_REDZONE
-	slab = NULL;
-	zone = NULL;
 	alloc = redzone_get_size(addr);
 #else
 	vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab);