summaryrefslogtreecommitdiff
path: root/plugins
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 /plugins
parent84efc00d07f9574c3867f96a3a7333b0f9d154e6 (diff)
Increased the reference counter for provided operands and updated code.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/androhelpers/params.c2
-rw-r--r--plugins/androhelpers/switch.c2
-rw-r--r--plugins/dalvik/fetch.c2
-rw-r--r--plugins/dalvik/link.c2
-rw-r--r--plugins/dalvik/operand.c2
-rw-r--r--plugins/fmtp/parser.c4
-rw-r--r--plugins/pychrysa/arch/instruction.c2
-rw-r--r--plugins/stackvars/stackvars.c2
8 files changed, 16 insertions, 2 deletions
diff --git a/plugins/androhelpers/params.c b/plugins/androhelpers/params.c
index ea85b89..f5c22b9 100644
--- a/plugins/androhelpers/params.c
+++ b/plugins/androhelpers/params.c
@@ -163,6 +163,8 @@ static void visit_all_method_operands(const GDexMethod *method, GArchInstruction
else if (G_IS_DALVIK_ARGS_OPERAND(operand))
process_args_operand(method, G_DALVIK_ARGS_OPERAND(operand));
+ g_object_unref(G_OBJECT(operand));
+
}
g_arch_instruction_unlock_operands(iter);
diff --git a/plugins/androhelpers/switch.c b/plugins/androhelpers/switch.c
index 20e6037..0e8b6ed 100644
--- a/plugins/androhelpers/switch.c
+++ b/plugins/androhelpers/switch.c
@@ -89,6 +89,8 @@ static bool load_dex_switch(const GArchInstruction *instr, GArchInstruction *ins
imm = NULL; //g_dalvik_target_operand_get_value(G_DALVIK_TARGET_OPERAND(operand));
+ g_object_unref(G_OBJECT(operand));
+
if (!g_imm_operand_to_vmpa_t(imm, &addr))
return false;
diff --git a/plugins/dalvik/fetch.c b/plugins/dalvik/fetch.c
index aa17a9f..1ac6fa2 100644
--- a/plugins/dalvik/fetch.c
+++ b/plugins/dalvik/fetch.c
@@ -56,6 +56,8 @@ void help_fetching_with_dalvik_instruction(GArchInstruction *instr, GArchProcess
status = g_imm_operand_to_virt_t(G_IMM_OPERAND(op), &target);
assert(status);
+ g_object_unref(G_OBJECT(op));
+
if (status)
g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, target);
diff --git a/plugins/dalvik/link.c b/plugins/dalvik/link.c
index 5fa0c26..502b7a3 100644
--- a/plugins/dalvik/link.c
+++ b/plugins/dalvik/link.c
@@ -127,6 +127,8 @@ void handle_dalvik_packed_switch_links(GArchInstruction *instr, GArchProcessor *
}
}
+ g_object_unref(G_OBJECT(op));
+
if (defined)
{
switch_ins = g_arch_processor_find_instr_by_address(proc, &addr);
diff --git a/plugins/dalvik/operand.c b/plugins/dalvik/operand.c
index e37a0bb..12fcca5 100644
--- a/plugins/dalvik/operand.c
+++ b/plugins/dalvik/operand.c
@@ -749,4 +749,6 @@ void dalvik_mark_first_operand_as_written(GArchInstruction *instr)
g_dalvik_register_operand_mark_as_written(G_DALVIK_REGISTER_OPERAND(operand));
+ g_object_unref(G_OBJECT(operand));
+
}
diff --git a/plugins/fmtp/parser.c b/plugins/fmtp/parser.c
index fe41e9b..994b7b4 100644
--- a/plugins/fmtp/parser.c
+++ b/plugins/fmtp/parser.c
@@ -116,7 +116,7 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format,
g_imm_operand_set_default_display(imm, def->disp_rules[i]);
- // TODO : unref(imm)
+ g_object_unref(G_OBJECT(imm));
}
@@ -139,7 +139,7 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format,
imm = G_IMM_OPERAND(g_arch_instruction_get_operand(instr, 0));
raw = g_imm_operand_get_raw_value(imm);
- // TODO : unref(imm)
+ g_object_unref(G_OBJECT(imm));
for (i = 0; i < def->comment.ccount; i++)
{
diff --git a/plugins/pychrysa/arch/instruction.c b/plugins/pychrysa/arch/instruction.c
index 61d1987..bb977ce 100644
--- a/plugins/pychrysa/arch/instruction.c
+++ b/plugins/pychrysa/arch/instruction.c
@@ -341,6 +341,8 @@ static PyObject *py_arch_instruction_get_operands(PyObject *self, void *unused)
ret = PyTuple_SetItem(result, i, Py_BuildValue("O", opobj));
assert(ret == 0);
+ g_object_unref(G_OBJECT(operand));
+
}
g_arch_instruction_unlock_operands(instr);
diff --git a/plugins/stackvars/stackvars.c b/plugins/stackvars/stackvars.c
index ce9d539..1b5a188 100644
--- a/plugins/stackvars/stackvars.c
+++ b/plugins/stackvars/stackvars.c
@@ -223,6 +223,8 @@ static bool replace_stack_vars_in_instruction(GArchInstruction *instr, GBinRouti
}
+ g_object_unref(G_OBJECT(operand));
+
}
g_arch_instruction_unlock_operands(instr);