summaryrefslogtreecommitdiff
path: root/src/analysis/contents
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/contents')
-rw-r--r--src/analysis/contents/memory.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/analysis/contents/memory.c b/src/analysis/contents/memory.c
index e28d31c..0b14a48 100644
--- a/src/analysis/contents/memory.c
+++ b/src/analysis/contents/memory.c
@@ -192,6 +192,8 @@ static void g_memory_content_init(GMemoryContent *content)
g_binary_content_set_attributes(G_BIN_CONTENT(content), empty);
+ g_object_unref(G_OBJECT(empty));
+
content->data = NULL;
content->length = 0;
@@ -372,7 +374,10 @@ GBinContent *g_memory_content_new(const bin_t *data, phys_t size)
static void g_memory_content_set_attributes(GMemoryContent *content, GContentAttributes *attribs)
{
+ g_clear_object(&content->attribs);
+
content->attribs = attribs;
+ g_object_unref(G_OBJECT(attribs));
}
@@ -395,6 +400,9 @@ static GContentAttributes *g_memory_content_get_attributes(const GMemoryContent
result = content->attribs;
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
+
return result;
}
@@ -418,6 +426,8 @@ static GBinContent *g_memory_content_get_root(GMemoryContent *content)
result = G_BIN_CONTENT(content);
+ g_object_ref(G_OBJECT(result));
+
return result;
}