[PATCH 3/3] playlist_display: prevent a double-free

Jonathan Neuschäfer <[email protected]> Thu, 20 Dec 2012 13:08:28 +0100
Newsgroups gmane.comp.ipod.gtkpod
Message-ID <[email protected]>
This crash could previously be triggered by dragging a newly
created (and not yet saved) playlist from one local repository
to another.
---
 plugins/playlist_display/display_playlists.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/playlist_display/display_playlists.c b/plugins/playlist_display/display_playlists.c
index 380834e..f2d1300 100644
--- a/plugins/playlist_display/display_playlists.c
+++ b/plugins/playlist_display/display_playlists.c
@@ -765,6 +765,7 @@ static void pm_drag_data_received(GtkWidget *widget, GdkDragContext *dc, gint x,
             if (pos == GTK_TREE_VIEW_DROP_AFTER)
                 pl_d = gp_playlist_add_new(pl->itdb, pl_s->name, FALSE, position + 1);
             g_free(data_copy);
+            data_copy = NULL;
             g_return_if_fail (pl_d);
 
             /* copy files from iPod if necessary */
-- 
1.7.10.4


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d