mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 23:15:16 +00:00
core/iwasm/aot/aot_loader.c: Fix a zero-sized malloc warning (#1108)
Fix the following warning when loading an aot file without relocations: ``` [20:19:00:528 - 1119F1600]: warning: wasm_runtime_malloc with size zero ```
This commit is contained in:
parent
a85f982297
commit
67d6a2886e
|
@ -2063,10 +2063,12 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
symbols = loader_malloc((uint64)sizeof(*symbols) * symbol_count, error_buf,
|
||||
error_buf_size);
|
||||
if (symbols == NULL) {
|
||||
goto fail;
|
||||
if (symbol_count > 0) {
|
||||
symbols = loader_malloc((uint64)sizeof(*symbols) * symbol_count,
|
||||
error_buf, error_buf_size);
|
||||
if (symbols == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(BH_PLATFORM_WINDOWS)
|
||||
|
|
Loading…
Reference in New Issue
Block a user