free(NULL) is safe.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 16 Jul 2009 06:37:42 +0000 (08:37 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 16 Jul 2009 06:37:42 +0000 (08:37 +0200)
src/misc/filter_chain.c
src/text/filesystem.c

index d7de880..e470bef 100644 (file)
@@ -466,8 +466,7 @@ static int filter_chain_DeleteFilterInternal( filter_chain_t *p_chain,
     vlc_object_release( p_filter );
 
     vlc_mouse_t *p_mouse = vlc_array_item_at_index( &p_chain->mouses, i_filter_idx );
-    if( p_mouse )
-        free( p_mouse );
+    free( p_mouse );
     vlc_array_remove( &p_chain->mouses, i_filter_idx );
 
     /* FIXME: check fmt_in/fmt_out consitency */
index bc602ae..cb3dc3d 100644 (file)
@@ -339,8 +339,7 @@ int utf8_loaddir( DIR *dir, char ***namelist,
 
         for( i = 0; i < num; i++ )
             free( tab[i] );
-        if( tab != NULL )
-            free( tab );
+        free( tab );
         }
     }
     return -1;