[vala/0.36] g-i: Fix return value on error in start_discriminator()



commit 27bf833c573e5c363e84b47285a33508e4bef85e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Jan 29 18:22:39 2019 +0100

    g-i: Fix return value on error in start_discriminator()

 gobject-introspection/gidlparser.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gobject-introspection/gidlparser.c b/gobject-introspection/gidlparser.c
index 6a76b2ca7..81494414f 100644
--- a/gobject-introspection/gidlparser.c
+++ b/gobject-introspection/gidlparser.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]