]> Pileus Git - ~andy/gtk/commitdiff
GtkIconView: fix a memory corruption in the drag-n-drop code
authorClaudio Saavedra <csaavedra@igalia.com>
Thu, 1 Dec 2011 21:47:36 +0000 (22:47 +0100)
committerClaudio Saavedra <csaavedra@igalia.com>
Thu, 1 Dec 2011 21:56:43 +0000 (22:56 +0100)
You shall free with g_slice_free() what you allocate with
g_slice_new().

https://bugzilla.gnome.org/show_bug.cgi?id=665338

gtk/gtkiconview.c

index e12bd46582eb4ec63f0d879da80576b3e776bef7..67141eca421a201f75a8ada6fef52013fbba2040 100644 (file)
@@ -6133,6 +6133,11 @@ drag_scroll_timeout (gpointer datap)
   return TRUE;
 }
 
+static void
+drag_scroll_data_free (DragScrollData *data)
+{
+  g_slice_free (DragScrollData, data);
+}
 
 static gboolean
 set_destination (GtkIconView    *icon_view,
@@ -6530,7 +6535,7 @@ gtk_icon_view_drag_motion (GtkWidget      *widget,
           data->device = gdk_drag_context_get_device (context);
 
          icon_view->priv->scroll_timeout_id =
-           gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 50, drag_scroll_timeout, data, g_free);
+           gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 50, drag_scroll_timeout, data, (GDestroyNotify) drag_scroll_data_free);
        }
 
       if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))