summaryrefslogtreecommitdiff
path: root/plugins/libcsem/exit.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-15 13:40:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-15 13:40:28 (GMT)
commit124c8410dbfcad59d66b850c50c96ec73a607ab7 (patch)
treeb7127c66abfccd11b9126741e2809a893ee44143 /plugins/libcsem/exit.c
parentdb1a6171007a6641a4659392c9bcc05670396643 (diff)
Defined proper accesses to instructions loaded by a processor.
Diffstat (limited to 'plugins/libcsem/exit.c')
-rw-r--r--plugins/libcsem/exit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/libcsem/exit.c b/plugins/libcsem/exit.c
index cbfec64..20511aa 100644
--- a/plugins/libcsem/exit.c
+++ b/plugins/libcsem/exit.c
@@ -70,6 +70,9 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c
instr = g_arch_processor_find_instr_by_address(proc, get_mrange_addr(range));
+ if (instr == NULL)
+ goto mokoear_not_found;
+
g_arch_instruction_rlock_src(instr);
count = g_arch_instruction_get_sources(instr, &sources);
@@ -83,6 +86,10 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c
g_arch_instruction_runlock_src(instr);
+ g_object_unref(G_OBJECT(instr));
+
+ mokoear_not_found:
+
g_object_unref(G_OBJECT(proc));
mokoear_done_with_sym: