summaryrefslogtreecommitdiff
path: root/plugins/javadesc
diff options
context:
space:
mode:
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;
}