summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-10-24 22:05:04 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-10-24 22:05:04 (GMT)
commitda03e81474f8e5271c61cb88cb56bb1f9e2b3cfd (patch)
tree9acce85d020f4e2c5eab453f043fbf3c60e2b5ba /src/analysis
parenta27f101ec7351a006537e819f9af55271620bc50 (diff)
Fix mistakes in reference counters for binary contents.
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/content.c10
-rw-r--r--src/analysis/contents/memory.c2
2 files changed, 1 insertions, 11 deletions
diff --git a/src/analysis/content.c b/src/analysis/content.c
index 7208f94..6d8075c 100644
--- a/src/analysis/content.c
+++ b/src/analysis/content.c
@@ -77,20 +77,12 @@ static void g_binary_content_default_init(GBinContentInterface *iface)
void g_binary_content_set_attributes(GBinContent *content, GContentAttributes *attribs)
{
- GContentAttributes *old; /* Ancien jeu d'attributs */
GBinContentIface *iface; /* Interface utilisée */
iface = G_BIN_CONTENT_GET_IFACE(content);
- old = iface->get_attribs(content);
-
- if (old != NULL)
- g_object_unref(G_OBJECT(old));
-
iface->set_attribs(content, attribs);
- g_object_ref_sink(G_OBJECT(attribs));
-
}
@@ -115,8 +107,6 @@ GContentAttributes *g_binary_content_get_attributes(const GBinContent *content)
result = iface->get_attribs(content);
- g_object_ref(G_OBJECT(result));
-
return result;
}
diff --git a/src/analysis/contents/memory.c b/src/analysis/contents/memory.c
index 0b14a48..9ddc4fa 100644
--- a/src/analysis/contents/memory.c
+++ b/src/analysis/contents/memory.c
@@ -377,7 +377,7 @@ static void g_memory_content_set_attributes(GMemoryContent *content, GContentAtt
g_clear_object(&content->attribs);
content->attribs = attribs;
- g_object_unref(G_OBJECT(attribs));
+ g_object_ref(G_OBJECT(attribs));
}