summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/contents/restricted.c2
-rw-r--r--src/analysis/disass/area.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/analysis/contents/restricted.c b/src/analysis/contents/restricted.c
index 1c0c8e6..8e5242e 100644
--- a/src/analysis/contents/restricted.c
+++ b/src/analysis/contents/restricted.c
@@ -213,7 +213,7 @@ static void g_restricted_content_interface_init(GBinContentInterface *iface)
static void g_restricted_content_dispose(GRestrictedContent *content)
{
- g_object_unref(G_OBJECT(content->internal));
+ g_clear_object(&content->internal);
G_OBJECT_CLASS(g_restricted_content_parent_class)->dispose(G_OBJECT(content));
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index f1aa002..9649d6f 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -277,15 +277,17 @@ static void init_mem_area_from_addr(mem_area *area, const vmpa2t *addr, phys_t l
area->format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
- content = g_binary_format_get_content(area->format);
-
area->proc = g_loaded_binary_get_processor(binary);
area->endianness = g_arch_processor_get_endianness(area->proc);
init_mrange(&area->range, addr, len);
+ content = g_binary_format_get_content(area->format);
+
area->content = g_restricted_content_new(content, &area->range);
+ g_object_unref(G_OBJECT(content));
+
switch (g_arch_processor_get_instruction_min_size(area->proc))
{
case MDS_4_BITS: