]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
g-i: Fix return value on error in start_discriminator() 6da1f01d3d2ae93c03c42624b5e9b83b3b121f8f
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 29 Jan 2019 17:22:39 +0000 (18:22 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 29 Jan 2019 17:48:18 +0000 (18:48 +0100)
gobject-introspection/gidlparser.c

index 6a76b2ca7b112a027cf6a6a55e96e48e42698c16..81494414fb79447982ef2089d633f5d8de6789ba 100644 (file)
@@ -1562,9 +1562,16 @@ start_discriminator (GMarkupParseContext *context,
       type = find_attribute ("type", attribute_names, attribute_values);
       offset = find_attribute ("offset", attribute_names, attribute_values);
       if (type == NULL)
-       MISSING_ATTRIBUTE (error, element_name, "type");
+        {
+          MISSING_ATTRIBUTE (error, element_name, "type");
+          return FALSE;
+        }
       else if (offset == NULL)
-       MISSING_ATTRIBUTE (error, element_name, "offset");
+        {
+          MISSING_ATTRIBUTE (error, element_name, "offset");
+          return FALSE;
+        }
+      else
        {
          ((GIdlNodeUnion *)ctx->current_node)->discriminator_type 
            = parse_type (type);