]> git.sesse.net Git - vlc/blobdiff - modules/codec/fake.c
Useless test before a free()
[vlc] / modules / codec / fake.c
index 0a8a21727ed1525df32705c9e8a8dd7bc707ff10..3861c51c9aca45b8ee0ba25b3c45c81944068e81 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_codec.h>
 
@@ -221,7 +225,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
     msg_Dbg( p_dec, "file %s loaded successfully", psz_file );
 
-    if ( psz_file ) free( psz_file );
+    free( psz_file );
 
     if ( b_keep_ar )
     {
@@ -300,7 +304,7 @@ static int OpenDecoder( vlc_object_t *p_this )
         p_handler = image_HandlerCreate( p_dec );
         p_image = image_Filter( p_handler, p_old, &fmt_out, val.psz_string );
         image_HandlerDelete( p_handler );
-        if ( val.psz_string != NULL ) free( val.psz_string );
+        free( val.psz_string );
 
         if ( p_image == NULL )
         {
@@ -384,6 +388,7 @@ static int FakeCallback( vlc_object_t *p_this, char const *psz_var,
                          vlc_value_t oldval, vlc_value_t newval,
                          void *p_data )
 {
+    VLC_UNUSED(p_this); VLC_UNUSED(oldval);
     decoder_t *p_dec = (decoder_t *)p_data;
 
     if( !strcmp( psz_var, "fake-file" ) )