From 3a9e5bd7bf92e5085c4141b9d797b998debe189e Mon Sep 17 00:00:00 2001 From: Tilen Majerle Date: Tue, 4 May 2021 07:57:26 +0200 Subject: [PATCH] Fix NULL parameter for region --- lwmem/src/lwmem/lwmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lwmem/src/lwmem/lwmem.c b/lwmem/src/lwmem/lwmem.c index eda9a94..59162f2 100644 --- a/lwmem/src/lwmem/lwmem.c +++ b/lwmem/src/lwmem/lwmem.c @@ -648,7 +648,7 @@ prv_realloc(lwmem_t* const lw, const lwmem_region_t* region, void* const ptr, co * * Final solution is to find completely new empty block of sufficient size and copy content from old one to new one */ - retval = prv_alloc(lw, NULL, size); /* Try to allocate new block */ + retval = prv_alloc(lw, region, size); /* Try to allocate new block */ if (retval != NULL) { block_size = (block->size & ~LWMEM_ALLOC_BIT) - LWMEM_BLOCK_META_SIZE; /* Get application size from input pointer */ LWMEM_MEMCPY(retval, ptr, size > block_size ? block_size : size); /* Copy content to new allocated block */