[vlc-devel] commit: free(NULL) is safe. ( Rémi Duraffort )
git version control
git at videolan.org
Thu Jul 16 08:58:52 CEST 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 16 08:37:42 2009 +0200| [d5fd75161509b82a98b0ed81f60d09dc69b6ff5a] | committer: Rémi Duraffort
free(NULL) is safe.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5fd75161509b82a98b0ed81f60d09dc69b6ff5a
---
src/misc/filter_chain.c | 3 +--
src/text/filesystem.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index d7de880..e470bef 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -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 */
diff --git a/src/text/filesystem.c b/src/text/filesystem.c
index bc602ae..cb3dc3d 100644
--- a/src/text/filesystem.c
+++ b/src/text/filesystem.c
@@ -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;
More information about the vlc-devel
mailing list