]> granicus.if.org Git - transmission/commitdiff
(trunk gtk) fix condition that could crash in some cases when right-clicking in the...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 13 Mar 2011 16:45:32 +0000 (16:45 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 13 Mar 2011 16:45:32 +0000 (16:45 +0000)
gtk/file-list.c

index 22a115c461e6f4e4fb227b714ccf4789ffad636d..0f60e88a1c79d66e802c3e07d5770b1999d49f92 100644 (file)
@@ -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;