From 02b5b6ab06d66e74c020365b186b2b6f602d5b66 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 19 Nov 2024 12:47:47 +0900 Subject: [PATCH] wasm: Plug a resource leak on exception (CID 508177) Signed-off-by: Hiroshi Hatake --- src/wasm/flb_wasm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wasm/flb_wasm.c b/src/wasm/flb_wasm.c index a71ff85f4cf..a6810e2530e 100644 --- a/src/wasm/flb_wasm.c +++ b/src/wasm/flb_wasm.c @@ -168,6 +168,8 @@ struct flb_wasm *flb_wasm_instantiate(struct flb_config *config, const char *was if (!wasm_runtime_full_init(&wasm_args)) { flb_error("Init runtime environment failed."); + flb_free(fw); + return NULL; }