summaryrefslogtreecommitdiff
path: root/src/analysis/contents
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-09-18 07:09:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-09-18 07:09:16 (GMT)
commit264be7bafd7ab92ddadc5c0d9d5c4489c9cda5d4 (patch)
treee671f20f1b78d739a2faea5330460b3a22dab810 /src/analysis/contents
parent7abda358d11810e464f2bf51f8333836ddc17e90 (diff)
Loaded APK files using a Python script.
Diffstat (limited to 'src/analysis/contents')
-rw-r--r--src/analysis/contents/encapsulated.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/analysis/contents/encapsulated.c b/src/analysis/contents/encapsulated.c
index e307e6b..74795ea 100644
--- a/src/analysis/contents/encapsulated.c
+++ b/src/analysis/contents/encapsulated.c
@@ -225,11 +225,9 @@ static void g_encaps_content_interface_init(GBinContentInterface *iface)
static void g_encaps_content_dispose(GEncapsContent *content)
{
- if (content->base != NULL)
- g_object_unref(content->base);
+ g_clear_object(&content->base);
- if (content->endpoint != NULL)
- g_object_unref(content->endpoint);
+ g_clear_object(&content->endpoint);
G_OBJECT_CLASS(g_encaps_content_parent_class)->dispose(G_OBJECT(content));
@@ -281,6 +279,9 @@ GBinContent *g_encaps_content_new(GBinContent *base, const char *path, GBinConte
result = g_object_new(G_TYPE_ENCAPS_CONTENT, NULL);
+ g_object_ref(base);
+ g_object_ref(endpoint);
+
result->base = base;
result->path = strdup(path);
result->endpoint = endpoint;
@@ -349,10 +350,12 @@ GBinContent *g_encaps_content_new_from_xml(xmlXPathContextPtr context, const cha
endpoint = NULL;/// TODO
if (endpoint != NULL)
+ {
result = g_encaps_content_new(original, target, endpoint);
+ g_object_unref(G_OBJECT(endpoint));
+ }
- else
- g_object_unref(G_OBJECT(original));
+ g_object_unref(G_OBJECT(original));
}
else