From: Corentin Noël Date: Fri, 16 Nov 2018 13:55:00 +0000 (+0100) Subject: glib-2.0: Avoid double-free in GLib.Array if clear_func is set X-Git-Tag: 0.43.1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=168b4efda30dd9bca16a6ea101b49f0e4ac36ac2;p=thirdparty%2Fvala.git glib-2.0: Avoid double-free in GLib.Array if clear_func is set --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 39a7a361c..fee5c1d7f 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -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;