Fix a potential memory leak issue in wasm_native_init (#1465)
Should call `wasm_native_destroy` to destroy the registered native libs when registering native lib failed in `wasm_native_init`.
This commit is contained in:
@ -45,7 +45,7 @@ librats_verify_wrapper(wasm_exec_env_t exec_env, const char *evidence_json,
|
||||
/* clang-format off */
|
||||
#define REG_NATIVE_FUNC(func_name, signature) \
|
||||
{ #func_name, func_name##_wrapper, signature, NULL }
|
||||
/* clang-format off */
|
||||
/* clang-format on */
|
||||
|
||||
static NativeSymbol native_symbols_lib_rats[] = {
|
||||
REG_NATIVE_FUNC(librats_collect, "($)i"),
|
||||
|
||||
Reference in New Issue
Block a user