]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Avoid double-free in GLib.Array if clear_func is set
authorCorentin Noël <corentin@elementary.io>
Fri, 16 Nov 2018 13:55:00 +0000 (14:55 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 16 Nov 2018 17:46:45 +0000 (18:46 +0100)
vapi/glib-2.0.vapi

index 39a7a361c50e79e996790a1db08deebc38501180..fee5c1d7fbf83cb481ab844a441cadc3bd85b687 100644 (file)
@@ -5295,14 +5295,14 @@ namespace GLib {
                [CCode (cname = "vala_g_array_remove_index")]
                public G remove_index (uint index) {
                        assert (length > index);
-                       G g = data[index];
+                       G g = (owned) data[index];
                        _remove_index (index);
                        return g;
                }
                [CCode (cname = "vala_g_array_remove_index_fast")]
                public G remove_index_fast (uint index) {
                        assert (length > index);
-                       G g = data[index];
+                       G g = (owned) data[index];
                        _remove_index_fast (index);
                        return g;
                }
@@ -5311,7 +5311,7 @@ namespace GLib {
                        assert (this.length >= index + length);
                        G[] ga = new G[length];
                        for (uint i = 0; i < length; i++) {
-                               ga[i] = data[i + index];
+                               ga[i] = (owned) data[i + index];
                        }
                        _remove_range (index, length);
                        return ga;