Update g array ref
[babeltrace.git] / types / enum.c
index 38a972a9c300392c467e56840df3312dad657691..6ad4d45038eabf37da04b05944b290d3bff983fe 100644 (file)
@@ -62,8 +62,10 @@ GArray *enum_uint_to_quark_set(const struct type_class_enum *enum_class,
                        g_array_index(ranges, struct enum_range, ranges->len) = iter->range;
                }
        }
-       if (!ranges)
+       if (!ranges) {
                ranges = qs;
+               g_array_ref(ranges);
+       }
        return ranges;
 }
 
@@ -101,8 +103,10 @@ GArray *enum_int_to_quark_set(const struct type_class_enum *enum_class, uint64_t
                        g_array_index(ranges, struct enum_range, ranges->len) = iter->range;
                }
        }
-       if (!ranges)
+       if (!ranges) {
                ranges = qs;
+               g_array_ref(ranges);
+       }
        return ranges;
 }
 
This page took 0.024777 seconds and 4 git commands to generate.