summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-18 23:02:24 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-18 23:02:24 (GMT)
commit6c6c743daf3c1de391c9ff2586a7df60bd7b7759 (patch)
treedfac981d09a081867dfa99d9028211c20fcc3da8 /src/analysis
parentb8a99266e691ec5a2a13f10d6c775f4bdc0dbbc2 (diff)
Used the reference counter when providing basic block lists.
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/rank.c2
-rw-r--r--src/analysis/routine.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/analysis/disass/rank.c b/src/analysis/disass/rank.c
index b4a8f92..b6eb4c5 100644
--- a/src/analysis/disass/rank.c
+++ b/src/analysis/disass/rank.c
@@ -130,4 +130,6 @@ void rank_routine_blocks(GBinRoutine *routine)
g_object_unref(G_OBJECT(start));
+ g_object_unref(G_OBJECT(blocks));
+
}
diff --git a/src/analysis/routine.c b/src/analysis/routine.c
index fa68ecd..4116044 100644
--- a/src/analysis/routine.c
+++ b/src/analysis/routine.c
@@ -710,7 +710,13 @@ size_t g_binary_routine_get_var_index_from_offset(const GBinRoutine *routine, si
GBlockList *g_binary_routine_get_basic_blocks(const GBinRoutine *routine)
{
- return routine->blocks;
+ GBlockList *result; /* Instance de liste à renvoyer*/
+
+ result = routine->blocks;
+
+ g_object_ref(G_OBJECT(result));
+
+ return result;
}