Fix module_realloc with NULL ptr issue (#1175)

Fix module_realloc with NULL ptr issue reported by #1173.
This commit is contained in:
Wenyong Huang
2022-05-19 11:57:33 +08:00
committed by GitHub
parent d7a2888b18
commit c72501781a
2 changed files with 3 additions and 3 deletions

View File

@ -1837,7 +1837,7 @@ aot_module_realloc(AOTModuleInstance *module_inst, uint32 ptr, uint32 size,
if (memory_inst->heap_handle.ptr) {
addr = mem_allocator_realloc(
memory_inst->heap_handle.ptr,
(uint8 *)memory_inst->memory_data.ptr + ptr, size);
ptr ? (uint8 *)memory_inst->memory_data.ptr + ptr : NULL, size);
}
/* Only support realloc in WAMR's app heap */