From dc536538ad8819d2afc1fe6c9f66ddd5aa014d9e Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Tue, 29 Sep 2020 10:34:06 +0800 Subject: [PATCH] Fix sgx enclave module not destroyed issue when loading module failed (#410) --- .../platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp b/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp index 5d2b96e3..ed9ca418 100644 --- a/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp +++ b/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp @@ -148,6 +148,7 @@ handle_cmd_load_module(uint64 *args, uint32 argc) if (!(enclave_module->module = wasm_runtime_load(enclave_module->wasm_file, wasm_file_size, error_buf, error_buf_size))) { + wasm_runtime_free(enclave_module); *(void **)args_org = NULL; return; }