summaryrefslogtreecommitdiff
path: root/plugins/javadesc
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-03-07 17:52:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-03-07 17:52:38 (GMT)
commit7a60504691ebd8b914592e60990cc3526cf26e29 (patch)
tree8093ae850e6dc720296c71deee3c3eb0a5763ed1 /plugins/javadesc
parenta79d209385fca4e74a6a85b2386be71ec23057bb (diff)
Compact data type definitions.
Diffstat (limited to 'plugins/javadesc')
-rw-r--r--plugins/javadesc/field.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/javadesc/field.c b/plugins/javadesc/field.c
index 799d39d..6396e03 100644
--- a/plugins/javadesc/field.c
+++ b/plugins/javadesc/field.c
@@ -66,6 +66,7 @@ static GDataType *jtd_object_type_descriptor(input_buffer *buffer)
GDataType *root; /* Espace de noms racine */
GDataType *ns; /* Espace de noms à attribuer */
GDataType *parent; /* Espace de noms parent */
+ bool status; /* Bilan de rattachement */
result = NULL;
@@ -108,7 +109,7 @@ static GDataType *jtd_object_type_descriptor(input_buffer *buffer)
ns = g_data_type_get_namespace(result);
if (ns == NULL)
- g_data_type_set_namespace(result, root, strdup("."));
+ status = g_data_type_set_namespace(result, root, ".");
else
{
@@ -118,12 +119,20 @@ static GDataType *jtd_object_type_descriptor(input_buffer *buffer)
ns = parent;
}
- g_data_type_set_namespace(ns, root, strdup("."));
+ status = g_data_type_set_namespace(ns, root, ".");
g_object_unref(G_OBJECT(ns));
}
+ g_object_unref(G_OBJECT(root));
+
+ if (!status)
+ {
+ g_clear_object(&result);
+ goto error;
+ }
+
}
break;
@@ -156,6 +165,8 @@ static GDataType *jtd_object_type_descriptor(input_buffer *buffer)
if (name != NULL)
result = g_class_enum_type_new(CEK_CLASS, name);
+ error:
+
return result;
}