summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-11-26 20:39:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-11-26 20:39:28 (GMT)
commit1252efcd18a845a7c2641354838c26ece3d6d873 (patch)
tree13d248454e99b76dd4c61fbd41c8c138ebb61eb7 /src/analysis/disass
parent84efc00d07f9574c3867f96a3a7333b0f9d154e6 (diff)
Increased the reference counter for provided operands and updated code.
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/links.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c
index 640d266..09f8d1b 100644
--- a/src/analysis/disass/links.c
+++ b/src/analysis/disass/links.c
@@ -237,7 +237,7 @@ static void convert_immediate_into_target(GArchInstruction *instr, size_t index,
ciit_done:
- ;
+ g_object_unref(G_OBJECT(op));
}
@@ -280,7 +280,7 @@ void establish_links_for_instruction(GArchInstruction *instr, GBinFormat *format
convert_immediate_into_target(instr, i, format);
op = _g_arch_instruction_get_operand(instr, i);
- if (!G_IS_TARGET_OPERAND(op)) continue;
+ if (!G_IS_TARGET_OPERAND(op)) goto next_op;
g_target_operand_get_addr(G_TARGET_OPERAND(op), &addr);
@@ -295,6 +295,10 @@ void establish_links_for_instruction(GArchInstruction *instr, GBinFormat *format
}
+ next_op:
+
+ g_object_unref(G_OBJECT(op));
+
}
g_arch_instruction_unlock_operands(instr);