mirror of
https://github.com/MaJerle/lwmem.git
synced 2025-01-13 21:42:53 +08:00
Fix NULL parameter for region
This commit is contained in:
parent
d6c62982aa
commit
3a9e5bd7bf
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user