From f9c24e8f0379c7bbeda1793742f7ef752472412c Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Thu, 1 Dec 2011 22:47:36 +0100 Subject: [PATCH] GtkIconView: fix a memory corruption in the drag-n-drop code 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index e12bd4658..67141eca4 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -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")) -- 2.43.2