From 7e396ee2c639867078bd2efed802be1f7dc81eb4 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Fri, 10 May 2024 02:28:55 -0500 Subject: [PATCH] Initialize variables --- cs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cs.c b/cs.c index 4ab838d539..dfeaaa0e1e 100644 --- a/cs.c +++ b/cs.c @@ -697,7 +697,7 @@ CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle) { cs_err err; - struct cs_struct *ud; + struct cs_struct *ud = NULL; if (!cs_mem_malloc || !cs_mem_calloc || !cs_mem_realloc || !cs_mem_free || !cs_vsnprintf) // Error: before cs_open(), dynamic memory management must be initialized // with cs_option(CS_OPT_MEM) @@ -745,8 +745,8 @@ cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle) CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle) { - struct cs_struct *ud; - struct insn_mnem *next, *tmp; + struct cs_struct *ud = NULL; + struct insn_mnem *next = NULL, *tmp = NULL; if (*handle == 0) // invalid handle