diff gui/mplayer/gtk/pl.c @ 32537:8fa2f43cb760

Remove most of the NULL pointer check before free all over the code
author cboesch
date Sun, 14 Nov 2010 09:12:34 +0000
parents 32725ca88fed
children 29b63f338a9b
line wrap: on
line diff
--- a/gui/mplayer/gtk/pl.c	Sat Nov 13 10:23:34 2010 +0000
+++ b/gui/mplayer/gtk/pl.c	Sun Nov 14 09:12:34 2010 +0000
@@ -160,7 +160,8 @@
 	DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( CTDirTree ),node );
 	current_path=DirNode->path;
         scan_dir( DirNode->path );
-        if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
+	free( CLFileSelected );
+	CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
 	break;
        }
     } while( pos );
@@ -195,7 +196,8 @@
  if ( !PlayList ) return;
  NrOfSelected=NrOfEntrys=0;
  gfree( (void **)&CLListSelected ); gfree( (void **)&CLFileSelected );
- if ( old_path ) free( old_path ); old_path=strdup( current_path );
+ free( old_path );
+ old_path=strdup( current_path );
  gtk_widget_hide( PlayList );
  gtk_widget_destroy( PlayList );
  PlayList=NULL;
@@ -406,7 +408,8 @@
  current_path=DirNode->path;
  gtk_ctree_expand( GTK_CTREE( widget ),node );
  scan_dir( DirNode->path );
- if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
+ free( CLFileSelected );
+ CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
 }
 
 GtkWidget * create_PlayList( void )