diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index fcf29191..d52a486a 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -3288,6 +3288,7 @@ insert_native_symbol(AOTCompContext *comp_ctx, const char *symbol, int32 idx) bh_assert(strlen(symbol) <= sizeof(sym->symbol)); ret = snprintf(sym->symbol, sizeof(sym->symbol), "%s", symbol); if (ret < 0 || ret + 1 > (int)sizeof(sym->symbol)) { + wasm_runtime_free(sym); aot_set_last_error_v("symbol name too long: %s", symbol); return false; }