[vlc-devel] commit: No need to test for NULL before a free. ( Rémi Duraffort )

git version control git at videolan.org
Sat Oct 10 11:57:46 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Oct  8 16:26:07 2009 +0200| [03415034a1105b095d5a43dc53b854e844850fad] | committer: Rémi Duraffort 

No need to test for NULL before a free.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03415034a1105b095d5a43dc53b854e844850fad
---

 modules/codec/kate.c        |    3 +--
 modules/misc/quartztext.c   |    2 +-
 modules/stream_filter/rar.c |    3 +--
 modules/stream_out/smem.c   |    3 +--
 src/input/decoder.c         |    3 +--
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/modules/codec/kate.c b/modules/codec/kate.c
index 871bcd7..6051554 100644
--- a/modules/codec/kate.c
+++ b/modules/codec/kate.c
@@ -1482,8 +1482,7 @@ static void DecSysRelease( decoder_sys_t *p_sys )
 #ifdef HAVE_TIGER
     if( p_sys->p_tr )
         tiger_renderer_destroy( p_sys->p_tr );
-    if( p_sys->psz_tiger_default_font_desc )
-        free( p_sys->psz_tiger_default_font_desc );
+    free( p_sys->psz_tiger_default_font_desc );
 #endif
 
     if (p_sys->b_ready)
diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index 0f332c7..c6100d3 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -506,7 +506,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
         {
             if( !strcasecmp( "face", psz_name ) )
             {
-                if( psz_fontname ) free( psz_fontname );
+                free( psz_fontname );
                 psz_fontname = strdup( psz_value );
             }
             else if( !strcasecmp( "size", psz_name ) )
diff --git a/modules/stream_filter/rar.c b/modules/stream_filter/rar.c
index 5c34333..b2ddc84 100644
--- a/modules/stream_filter/rar.c
+++ b/modules/stream_filter/rar.c
@@ -238,8 +238,7 @@ static int Peek( stream_t *s, const uint8_t **pp_peek, unsigned int i_peek )
         return i_read;
     }
 
-    if( p_sys->p_peek_alloc )
-        free( p_sys->p_peek_alloc );
+    free( p_sys->p_peek_alloc );
 
     p_sys->p_peek_alloc =
     p_sys->p_peek       = p_peek;
diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index 236639d..9c8b4cc 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -317,8 +317,7 @@ static sout_stream_id_t *AddAudio( sout_stream_t *p_stream, es_format_t *p_fmt )
 static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
 {
     VLC_UNUSED( p_stream );
-    if ( id != NULL )
-        free( id );
+    free( id );
     return VLC_SUCCESS;
 }
 
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 8385422..ae48f10 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1730,8 +1730,7 @@ static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block )
             p_owner->sout.i_id = p_dec->fmt_in.i_id;
             if( p_dec->fmt_in.psz_language )
             {
-                if( p_owner->sout.psz_language )
-                    free( p_owner->sout.psz_language );
+                free( p_owner->sout.psz_language );
                 p_owner->sout.psz_language =
                     strdup( p_dec->fmt_in.psz_language );
             }




More information about the vlc-devel mailing list