From 9acc096d0cd7f7eb0a8def1c2ef156ce5b5d109a Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 4 Dec 2024 15:43:41 +0900 Subject: [PATCH] wasm: Plug a resource leak on exception (CID 508177) (#9615) 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; }