From 699c43d916d412e4b3a38539d083d593a57b675d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 16 Jun 2024 12:38:40 +0900 Subject: [PATCH] insn_impl_control.h: fix an uninitialized use of "mctx" --- lib/insn_impl_control.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/insn_impl_control.h b/lib/insn_impl_control.h index 7dac2c3c..65d4e370 100644 --- a/lib/insn_impl_control.h +++ b/lib/insn_impl_control.h @@ -409,7 +409,9 @@ INSN_IMPL(br_table) SAVE_PC; INSN_SUCCESS; fail: - mem_free(mctx, table, vec_count * sizeof(uint32_t)); + if (table != NULL) { + mem_free(mctx, table, vec_count * sizeof(uint32_t)); + } INSN_FAIL; }