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:
Qiang
2022-09-08 14:22:34 +08:00
committed by GitHub
parent da79e3e9b2
commit 6820af6212
2 changed files with 14 additions and 11 deletions

View File

@ -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"),