From: Jordan Lee Date: Sun, 13 Mar 2011 16:45:32 +0000 (+0000) Subject: (trunk gtk) fix condition that could crash in some cases when right-clicking in the... X-Git-Tag: 2.30b1~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=018585d3b0c92c0402399f785dcbbdb662e0bfac;p=transmission (trunk gtk) fix condition that could crash in some cases when right-clicking in the file list menu. --- diff --git a/gtk/file-list.c b/gtk/file-list.c index 22a115c46..0f60e88a1 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -770,8 +770,8 @@ onViewButtonPressed( GtkWidget * w, GdkEventButton * event, gpointer gdata ) if(( tor = gtr_core_find_torrent( data->core, data->torrentId ))) { - GtkTreePath * path; GtkTreeViewColumn * col; + GtkTreePath * path = NULL; GtkTreeView * treeview = GTK_TREE_VIEW( w ); if( event->type == GDK_BUTTON_PRESS && event->button == 1 @@ -779,7 +779,8 @@ onViewButtonPressed( GtkWidget * w, GdkEventButton * event, gpointer gdata ) && getAndSelectEventPath( treeview, event, &col, &path ) ) handled = onViewPathToggled( treeview, col, path, data ); - gtk_tree_path_free( path ); + if( path != NULL ) + gtk_tree_path_free( path ); } return handled;