]> git.sesse.net Git - vlc/commitdiff
Another time "Remove useless test before a free".
authorRémi Duraffort <ivoire@videolan.org>
Tue, 11 Mar 2008 23:58:01 +0000 (00:58 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 12 Mar 2008 11:07:42 +0000 (12:07 +0100)
19 files changed:
modules/access/cdda.c
modules/access/cdda/access.c
modules/access/dc1394.c
modules/access/directory.c
modules/access/dshow/dshow.cpp
modules/access/dvdread.c
modules/access/ftp.c
modules/access/http.c
modules/access/jack.c
modules/access/rtsp/access.c
modules/access/rtsp/real.c
modules/access/rtsp/real_rmff.c
modules/access/rtsp/real_sdpplin.c
modules/access/rtsp/rtsp.c
modules/access/smb.c
modules/access/v4l.c
modules/access/v4l2/v4l2.c
modules/access/vcd/cdrom.c
modules/audio_filter/normvol.c

index fa982b610341914332af2eb9bff871d3d414f102..e23e91f175c162c3f048f274e6d71d76b9d46443 100644 (file)
@@ -154,7 +154,7 @@ static int Open( vlc_object_t *p_this )
         psz_name = var_CreateGetString( p_this, "cd-audio" );
         if( !psz_name || !*psz_name )
         {
-            if( psz_name ) free( psz_name );
+            free( psz_name );
             return VLC_EGENERIC;
         }
     }
@@ -478,8 +478,7 @@ static int GetTracks( access_t *p_access,
             {
                 if( cddb_track_get_title( t )  != NULL )
                 {
-                    if( p_input_item->psz_name )
-                        free( p_input_item->psz_name );
+                    free( p_input_item->psz_name );
                     p_input_item->psz_name = strdup( cddb_track_get_title( t ) );
                     input_item_SetTitle( p_input_item, cddb_track_get_title( t ) );
                 }
index 10510aaf71c0a2112f16ea8c493811f742d02303..087647b5a4839d804a8fa9c95948e5a19651735f 100644 (file)
@@ -306,8 +306,8 @@ static block_t * CDDAReadBlocks( access_t * p_access )
                     msg_Err( p_access, "%s%s\n", psz_mes ? psz_mes: "",
                              psz_err ? psz_err: "" );
 
-                if( psz_err ) free( psz_err );
-                if( psz_mes ) free( psz_mes );
+                free( psz_err );
+                free( psz_mes );
                 if( !p_readbuf )
                 {
                     msg_Err( p_access, "paranoia read error on frame %i\n",
@@ -400,7 +400,7 @@ CDDARead( access_t * p_access, uint8_t *p_buffer, size_t i_len )
         {
             char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
             input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
-            free(psz_title);
+            free( psz_title );
         }
         else
         {
@@ -628,8 +628,7 @@ int CDDAOpen( vlc_object_t *p_this )
     if( !(p_cdio = cdio_open( psz_source, DRIVER_UNKNOWN )) )
     {
         msg_Warn( p_access, "could not open %s", psz_source );
-        if ( psz_source )
-            free( psz_source );
+        free( psz_source );
         return VLC_EGENERIC;
     }
 
@@ -809,7 +808,7 @@ int CDDAOpen( vlc_object_t *p_this )
 
  error:
     cdio_destroy( p_cdda->p_cdio );
-    if( psz_source) free( psz_source );
+    free( psz_source );
     if( p_cdda )
     {
         if ( p_cdda->p_input )
@@ -857,8 +856,8 @@ void CDDAClose (vlc_object_t *p_this )
         cdio_cddap_close_no_free_cdio( p_cdda->paranoia_cd );
 #endif
 
-    if( p_cdda->psz_mcn )    free( p_cdda->psz_mcn );
-    if( p_cdda->psz_source ) free( p_cdda->psz_source );
+    free( p_cdda->psz_mcn );
+    free( p_cdda->psz_source );
 
 #if LIBCDDB_VERSION_NUM >= 1
     libcddb_shutdown();
@@ -1006,7 +1005,7 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args )
                     char *psz_title = CDDAFormatTitle( p_access, i_track );
                     input_Control( p_cdda->p_input, INPUT_SET_NAME,
                                    psz_title );
-                    free(psz_title);
+                    free( psz_title );
                     p_cdda->i_track = i_track;
                     i_last_lsn = cdio_get_track_lsn( p_cdda->p_cdio,
                                                 CDIO_CDROM_LEADOUT_TRACK );
index 9b73b514e9d187fd3f0b0a89e9d3b4a0a5a826c3..5c66ffabc96e967ff6d98973338aa8cad18f77d3 100644 (file)
@@ -628,10 +628,8 @@ static void Close( vlc_object_t *p_this )
         dc1394_destroy_handle( p_sys->fd_video );
     CloseAudioDev( p_demux );
 
-    if( p_sys->camera_nodes )
-        free( p_sys->camera_nodes );
-    if( p_sys->audio_device )
-        free( p_sys->audio_device );
+    free( p_sys->camera_nodes );
+    free( p_sys->audio_device );
 
     free( p_sys );
 }
@@ -859,7 +857,7 @@ static int process_options( demux_t *p_demux )
                     "video size of 160x120 is actually disabled for lack of chroma "
                     "support. It will relased ASAP, until then try an higher size "
                     "(320x240 and 640x480 are fully supported)" );
-                free(psz_dup);
+                free( psz_dup );
                 return VLC_EGENERIC;
 #if 0
                 p_sys->frame_size = MODE_160x120_YUV444;
@@ -886,7 +884,7 @@ static int process_options( demux_t *p_demux )
                     " 160x120, 320x240, and 640x480. "
                     "Please specify one of them. You have specified %s.",
                     token );
-                free(psz_dup);
+                free( psz_dup );
                 return VLC_EGENERIC;
             }
             msg_Dbg( p_demux, "Requested video size : %s",token );
@@ -914,7 +912,7 @@ static int process_options( demux_t *p_demux )
                     " 1.875, 3.75, 7.5, 15, 30, 60. "
                     "Please specify one of them. You have specified %s.",
                     token);
-                free(psz_dup);
+                free( psz_dup );
                 return VLC_EGENERIC;
             }
             msg_Dbg( p_demux, "Requested frame rate : %s",token );
@@ -929,7 +927,7 @@ static int process_options( demux_t *p_demux )
                 msg_Err( p_demux, "Bad brightness value '%s', "
                                   "must be an unsigned integer.",
                                   token );
-                free(psz_dup);
+                free( psz_dup );
                 return VLC_EGENERIC;
             }
         }
@@ -958,7 +956,7 @@ static int process_options( demux_t *p_demux )
                 msg_Err( p_demux, "Bad camera number '%s', "
                                   "must be an unsigned integer.",
                                   token );
-                free(psz_dup);
+                free( psz_dup );
                 return VLC_EGENERIC;
             }
         }
@@ -980,7 +978,7 @@ static int process_options( demux_t *p_demux )
                 msg_Err(p_demux, "Bad capture method value '%s', "
                                  "it can be 'raw1394' or 'video1394'.",
                                 token );
-                free(psz_dup);
+                free( psz_dup );
                 return VLC_EGENERIC;
             }
         }
@@ -1011,7 +1009,7 @@ static int process_options( demux_t *p_demux )
             sscanf( token, "0x%llx", &p_sys->selected_uid );
         }
     }
-    if( psz_dup ) free( psz_dup );
+    free( psz_dup );
     return VLC_SUCCESS;
 }
 
index f49a66f57146c8cccd97b8d8a8bd015b46ebe7f8..9d37d5eab519a0540b44ac0f7dc80589b280088b 100644 (file)
@@ -266,7 +266,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len)
 
     playlist_Signal( p_playlist );
 
-    if( psz_name ) free( psz_name );
+    free( psz_name );
     vlc_object_release( p_input );
     vlc_object_release( p_playlist );
 
@@ -455,7 +455,7 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name,
             psz_parser = ptr + 1;
         }
     }
-    if( psz_ignore ) free( psz_ignore );
+    free( psz_ignore );
 
     /* While we still have entries in the directory */
     for( i = 0; i < i_dir_content; i++ )
@@ -545,12 +545,12 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name,
     }
 
     for( i = 0; i < i_extensions; i++ )
-        if( ppsz_extensions[i] ) free( ppsz_extensions[i] );
-    if( ppsz_extensions ) free( ppsz_extensions );
+        free( ppsz_extensions[i] );
+    free( ppsz_extensions );
 
     for( i = 0; i < i_dir_content; i++ )
-        if( pp_dir_content[i] ) free( pp_dir_content[i] );
-    if( pp_dir_content ) free( pp_dir_content );
+        free( pp_dir_content[i] );
+    free( pp_dir_content );
 
     return i_return;
 }
index 582fa407b057a23cf1c7d8af2051da53347ecd37..404d8282a15d70962b2f5ff399fbbe5aa852d8b0 100644 (file)
@@ -333,12 +333,12 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
     var_Create( p_this, "dshow-vdev", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Get( p_this, "dshow-vdev", &val );
     if( val.psz_string ) vdevname = string( val.psz_string );
-    if( val.psz_string ) free( val.psz_string );
+    free( val.psz_string );
 
     var_Create( p_this, "dshow-adev", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Get( p_this, "dshow-adev", &val );
     if( val.psz_string ) adevname = string( val.psz_string );
-    if( val.psz_string ) free( val.psz_string );
+    free( val.psz_string );
 
     static struct {char *psz_size; int  i_width; int  i_height;} size_table[] =
     { { "subqcif", 128, 96 }, { "qsif", 160, 120 }, { "qcif", 176, 144 },
@@ -370,7 +370,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
             msg_Dbg( p_this, "width x height %dx%d", i_width, i_height );
         }
     }
-    if( val.psz_string ) free( val.psz_string );
+    free( val.psz_string );
 
     p_sys->b_chroma = VLC_FALSE;
     var_Create( p_this, "dshow-chroma", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
@@ -381,7 +381,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
                                val.psz_string[2], val.psz_string[3] );
         p_sys->b_chroma = VLC_TRUE;
     }
-    if( val.psz_string ) free( val.psz_string );
+    free( val.psz_string );
 
     var_Create( p_this, "dshow-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
     var_Create( p_this, "dshow-tuner-channel",
index f7d0d8abb4c6bcb07e76ec7e8f015501235f390f..6229670ab64c9be7c6057c7a7733ce67685f25e6 100644 (file)
@@ -229,7 +229,7 @@ static int Open( vlc_object_t *p_this )
 
         putenv( psz_env );
     }
-    if( psz_dvdcss_env ) free( psz_dvdcss_env );
+    free( psz_dvdcss_env );
 
     /* Open dvdread */
     if( !(p_dvdread = DVDOpen( psz_name )) )
index 09d9fed1c7900ad97fc55b26d0f2699076949ba1..8138995d4685180db8ab1106c5787b633b11cee6 100644 (file)
@@ -623,7 +623,7 @@ static int ftp_ReadCommand( vlc_object_t *p_access, access_sys_t *p_sys,
     if( psz_line == NULL || strlen( psz_line ) < 3 )
     {
         msg_Err( p_access, "cannot get answer" );
-        if( psz_line ) free( psz_line );
+        free( psz_line );
         if( pi_answer ) *pi_answer    = 500;
         if( ppsz_answer ) *ppsz_answer  = NULL;
         return -1;
index 44d3c196f41d8ae21fd91416435c7777257ce70e..0f74a5dd6c3d0c3d79fd0f9b34cbcc72382fc6a2 100644 (file)
@@ -356,14 +356,14 @@ connect:
                         psz_login, psz_password );
             if( psz_login ) p_sys->url.psz_username = strdup( psz_login );
             if( psz_password ) p_sys->url.psz_password = strdup( psz_password );
-            if( psz_login ) free( psz_login );
-            if( psz_password ) free( psz_password );
+            free( psz_login );
+            free( psz_password );
             goto connect;
         }
         else
         {
-            if( psz_login ) free( psz_login );
-            if( psz_password ) free( psz_password );
+            free( psz_login );
+            free( psz_password );
             goto error;
         }
     }
@@ -614,7 +614,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
             {
                 /* read the empty line */
                 char *psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd, p_sys->p_vs );
-                if( psz ) free( psz );
+                free( psz );
             }
         }
     }
@@ -712,8 +712,7 @@ static int ReadICYMeta( access_t *p_access )
         if( !p_sys->psz_icy_title ||
             strcmp( p_sys->psz_icy_title, &p[1] ) )
         {
-            if( p_sys->psz_icy_title )
-                free( p_sys->psz_icy_title );
+            free( p_sys->psz_icy_title );
             p_sys->psz_icy_title = strdup( &p[1] );
             p_access->info.i_update |= INPUT_UPDATE_META;
 
@@ -1241,12 +1240,12 @@ static int Request( access_t *p_access, int64_t i_tell )
                 psz_new_loc = strdup( p );
             }
 
-            if( p_sys->psz_location ) free( p_sys->psz_location );
+            free( p_sys->psz_location );
             p_sys->psz_location = psz_new_loc;
         }
         else if( !strcasecmp( psz, "Content-Type" ) )
         {
-            if( p_sys->psz_mime ) free( p_sys->psz_mime );
+            free( p_sys->psz_mime );
             p_sys->psz_mime = strdup( p );
             msg_Dbg( p_access, "Content-Type: %s", p_sys->psz_mime );
         }
@@ -1264,7 +1263,7 @@ static int Request( access_t *p_access, int64_t i_tell )
         {
             if( !strcasecmp( psz, "Pragma: features" ) )
                 p_sys->b_mms = VLC_TRUE;
-            if( p_sys->psz_pragma ) free( p_sys->psz_pragma );
+            free( p_sys->psz_pragma );
             p_sys->psz_pragma = strdup( p );
             msg_Dbg( p_access, "Pragma: %s", p_sys->psz_pragma );
         }
@@ -1305,7 +1304,7 @@ static int Request( access_t *p_access, int64_t i_tell )
         }
         else if( !strcasecmp( psz, "Icy-Name" ) )
         {
-            if( p_sys->psz_icy_name ) free( p_sys->psz_icy_name );
+            free( p_sys->psz_icy_name );
             p_sys->psz_icy_name = strdup( p );
             msg_Dbg( p_access, "Icy-Name: %s", p_sys->psz_icy_name );
 
@@ -1315,7 +1314,7 @@ static int Request( access_t *p_access, int64_t i_tell )
         }
         else if( !strcasecmp( psz, "Icy-Genre" ) )
         {
-            if( p_sys->psz_icy_genre ) free( p_sys->psz_icy_genre );
+            free( p_sys->psz_icy_genre );
             p_sys->psz_icy_genre = strdup( p );
             msg_Dbg( p_access, "Icy-Genre: %s", p_sys->psz_icy_genre );
         }
index 8e258137d259e7a1c41d9e4df7ea21d0db8ea179..0e6b45e99ea2ccf5d85e1e7fab4e6097d1767d02 100644 (file)
@@ -215,9 +215,9 @@ static int Open( vlc_object_t *p_this )
         {
             msg_Err( p_demux, "failed to register a JACK port" );
             if( p_sys->p_jack_client) jack_client_close( p_sys->p_jack_client );
-            if( p_sys->pp_jack_port_input ) free( p_sys->pp_jack_port_input );
+            free( p_sys->pp_jack_port_input );
             if( p_sys->p_jack_ringbuffer ) jack_ringbuffer_free( p_sys->p_jack_ringbuffer );
-            if( p_sys->pp_jack_buffer ) free( p_sys->pp_jack_buffer );
+            free( p_sys->pp_jack_buffer );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -240,9 +240,9 @@ static int Open( vlc_object_t *p_this )
     {
         msg_Err( p_demux, "failed to activate JACK client" );
         if( p_sys->p_jack_client) jack_client_close( p_sys->p_jack_client );
-        if( p_sys->pp_jack_port_input ) free( p_sys->pp_jack_port_input );
+        free( p_sys->pp_jack_port_input );
         if( p_sys->p_jack_ringbuffer ) jack_ringbuffer_free( p_sys->p_jack_ringbuffer );
-        if( p_sys->pp_jack_buffer ) free( p_sys->pp_jack_buffer );
+        free( p_sys->pp_jack_buffer );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -287,7 +287,7 @@ static int Open( vlc_object_t *p_this )
                     jack_port_name( p_sys->pp_jack_port_input[i_input_ports] ) );
             }
         }
-    if( pp_jack_port_output ) free( pp_jack_port_output );
+    free( pp_jack_port_output );
     }
 
     /* info about jack server */
@@ -327,9 +327,9 @@ static void Close( vlc_object_t *p_this )
     if( p_sys->p_block_audio ) block_Release( p_sys->p_block_audio );
     if( p_sys->p_jack_client ) jack_client_close( p_sys->p_jack_client );
     if( p_sys->p_jack_ringbuffer ) jack_ringbuffer_free( p_sys->p_jack_ringbuffer );
-    if( p_sys->pp_jack_port_input ) free( p_sys->pp_jack_port_input );
-    if( p_sys->pp_jack_buffer ) free( p_sys->pp_jack_buffer );
-    if( p_sys->pp_jack_port_table ) free( p_sys->pp_jack_port_table );
+    free( p_sys->pp_jack_port_input );
+    free( p_sys->pp_jack_buffer );
+    free( p_sys->pp_jack_port_table );
     free( p_sys );
 }
 
@@ -546,7 +546,7 @@ static void Port_finder( demux_t *p_demux )
         }
     }
 
-    if( pp_jack_port_output ) free( pp_jack_port_output );
+    free( pp_jack_port_output );
     p_sys->i_match_ports = i_total_out_ports;
 }
 
index 8c2d7bcba5d7ba11c3f7e35cfb60f167604b4671..d6305e4af351d6207ff838b255f65d257267d461 100644 (file)
@@ -131,7 +131,7 @@ static int RtspReadLine( void *p_userdata, uint8_t *p_buffer, int i_buffer )
     if( psz ) strncpy( (char *)p_buffer, psz, i_buffer );
     else *p_buffer = 0;
 
-    if( psz ) free( psz );
+    free( psz );
     return 0;
 }
 
@@ -248,11 +248,11 @@ static int Open( vlc_object_t *p_this )
     var_Create( p_access, "realrtsp-caching",
                 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
 
-    if( psz_server ) free( psz_server );
+    free( psz_server );
     return VLC_SUCCESS;
 
  error:
-    if( psz_server ) free( psz_server );
+    free( psz_server );
     Close( p_this );
     return VLC_EGENERIC;
 }
@@ -266,7 +266,7 @@ static void Close( vlc_object_t * p_this )
     access_sys_t *p_sys = p_access->p_sys;
 
     if( p_sys->p_rtsp ) rtsp_close( p_sys->p_rtsp );
-    if( p_sys->p_rtsp ) free( p_sys->p_rtsp );
+    free( p_sys->p_rtsp );
     free( p_sys );
 }
 
index 12062b25103358b843db737dcac690bb013977b7..da499ec2d35320b8c0155e09abc1ec50e07c6cb7 100644 (file)
@@ -480,7 +480,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
 
     if (!desc->stream[i]->mlti_data) {
       len = 0;
-      if( buf ) free( buf );
+      free( buf );
       buf = NULL;
     } else
       len=select_mlti_data(desc->stream[i]->mlti_data,
@@ -531,13 +531,13 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
   rmff_fix_header(header);
 
   if( desc ) sdpplin_free( desc );
-  if( buf ) free(buf);
+  free( buf );
   return header;
 
 error:
   if( desc ) sdpplin_free( desc );
   if( header ) rmff_free_header( header );
-  if( buf ) free( buf );
+  free( buf );
   return NULL;
 }
 
@@ -642,10 +642,10 @@ rmff_header_t  *real_setup_and_get_header(rtsp_client_t *rtsp_session, int bandw
         lprintf("real: got message from server:\n%s\n", alert);
     }
     printf( "bou\n");
-    rtsp_send_ok(rtsp_session);
-    if( challenge1 ) free(challenge1);
-    if( alert ) free(alert);
-    if( buf ) free(buf);
+    rtsp_send_ok( rtsp_session );
+    free( challenge1 );
+    free( alert );
+    free( buf );
     return NULL;
   }
 
@@ -724,19 +724,19 @@ rmff_header_t  *real_setup_and_get_header(rtsp_client_t *rtsp_session, int bandw
   rtsp_schedule_field(rtsp_session, "Range: npt=0-");
   rtsp_request_play(rtsp_session,NULL);
 
-  if( challenge1 ) free( challenge1 );
-  if( session_id ) free( session_id );
-  if( description ) free(description);
-  if( subscribe ) free(subscribe);
-  if( buf ) free(buf);
+  free( challenge1 );
+  free( session_id );
+  free( description );
+  free( subscribe );
+  free( buf );
   return h;
 
 error:
   if( h ) rmff_free_header( h );
-  if( challenge1 ) free( challenge1 );
-  if( session_id ) free( session_id );
-  if( description ) free(description);
-  if( subscribe ) free(subscribe);
-  if( buf ) free(buf);
+  free( challenge1 );
+  free( session_id );
+  free( description );
+  free( subscribe );
+  free( buf );
   return NULL;
 }
index d2072485127e3117399ce8c9eb7edf86d202ff57..73dc65580715bd8f5b68394f4527ef6bc5a695d4 100644 (file)
@@ -383,7 +383,7 @@ rmff_mdpr_t *rmff_new_mdpr(
 
   mdpr->type_specific_data = malloc(sizeof(char)*type_specific_len);
   if( !mdpr->type_specific_data ) {
-    if( mdpr->stream_name ) free( mdpr->stream_name );
+    free( mdpr->stream_name );
     free( mdpr );
     return NULL;
   }
@@ -609,15 +609,15 @@ void rmff_free_header(rmff_header_t *h)
 {
   if (!h) return;
 
-  if (h->fileheader) free(h->fileheader);
-  if (h->prop) free(h->prop);
-  if (h->data) free(h->data);
-  if (h->cont) {
-    free(h->cont->title);
-    free(h->cont->author);
-    free(h->cont->copyright);
-    free(h->cont->comment);
-    free(h->cont);
+  free( h->fileheader );
+  free( h->prop );
+  free( h->data );
+  if( h->cont ) {
+    free( h->cont->title );
+    free( h->cont->author );
+    free( h->cont->copyright );
+    free( h->cont->comment );
+    free( h->cont );
   }
   if (h->streams) {
     rmff_mdpr_t **s=h->streams;
index 67238767a49ddaa7de63dcccfd05e963792e628f..f12836734c3c96e7b4d9b96ef7072ac22c571d00 100644 (file)
@@ -209,14 +209,14 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
       *data=nl(*data);
     }
   }
-  if( buf ) free(buf);
-  if( decoded )free(decoded);
+  free( buf );
+  free( decoded) ;
   return desc;
 
 error:
-  if( decoded ) free(decoded);
-  if( desc ) free( desc );
-  if( buf ) free( buf );
+  free( decoded );
+  free( desc );
+  free( buf );
   return NULL;
 }
 
@@ -312,8 +312,8 @@ sdpplin_t *sdpplin_parse(char *data) {
     }
   }
 
-  free(decoded);
-  free(buf);
+  free( decoded );
+  free( buf );
   return desc;
 }
 
@@ -325,36 +325,36 @@ void sdpplin_free(sdpplin_t *description) {
 
   for( i=0; i<description->stream_count; i++ ) {
     if( description->stream[i] ) {
-      if( description->stream[i]->id ) free( description->stream[i]->id );
-      if( description->stream[i]->bandwidth ) free( description->stream[i]->bandwidth );
-      if( description->stream[i]->range ) free( description->stream[i]->range );
-      if( description->stream[i]->length ) free( description->stream[i]->length );
-      if( description->stream[i]->rtpmap ) free( description->stream[i]->rtpmap );
-      if( description->stream[i]->mimetype ) free( description->stream[i]->mimetype );
-      if( description->stream[i]->stream_name ) free( description->stream[i]->stream_name );
-      if( description->stream[i]->mime_type ) free( description->stream[i]->mime_type );
-      if( description->stream[i]->mlti_data ) free( description->stream[i]->mlti_data );
-      if( description->stream[i]->rmff_flags ) free( description->stream[i]->rmff_flags );
-      if( description->stream[i]->asm_rule_book ) free( description->stream[i]->asm_rule_book );
+      free( description->stream[i]->id );
+      free( description->stream[i]->bandwidth );
+      free( description->stream[i]->range );
+      free( description->stream[i]->length );
+      free( description->stream[i]->rtpmap );
+      free( description->stream[i]->mimetype );
+      free( description->stream[i]->stream_name );
+      free( description->stream[i]->mime_type );
+      free( description->stream[i]->mlti_data );
+      free( description->stream[i]->rmff_flags );
+      free( description->stream[i]->asm_rule_book );
       free( description->stream[i] );
     }
   }
   if( description->stream_count ) free( description->stream );
 
-  if( description->owner ) free( description->owner );
-  if( description->session_name ) free( description->session_name );
-  if( description->session_info ) free( description->session_info );
-  if( description->uri ) free( description->uri );
-  if( description->email ) free( description->email );
-  if( description->phone ) free( description->phone );
-  if( description->connection ) free( description->connection );
-  if( description->bandwidth ) free( description->bandwidth );
-  if( description->title ) free( description->title );
-  if( description->author ) free( description->author );
-  if( description->copyright ) free( description->copyright );
-  if( description->keywords ) free( description->keywords );
-  if( description->asm_rule_book ) free( description->asm_rule_book );
-  if( description->abstract ) free( description->abstract );
-  if( description->range ) free( description->range );
+  free( description->owner );
+  free( description->session_name );
+  free( description->session_info );
+  free( description->uri );
+  free( description->email );
+  free( description->phone );
+  free( description->connection );
+  free( description->bandwidth );
+  free( description->title );
+  free( description->author );
+  free( description->copyright );
+  free( description->keywords );
+  free( description->asm_rule_book );
+  free( description->abstract );
+  free( description->range );
   free(description);
 }
index 67b5b6eb8a97197d0a4d41c7b5a86965b32ce371..6730a931168951880e6452bbe4064aed7c7eef94 100644 (file)
@@ -240,7 +240,7 @@ static int rtsp_get_answers( rtsp_client_t *rtsp )
       {
           char *buf = malloc( strlen(answer) );
           sscanf( answer, "%*s %s", buf );
-          if( rtsp->p_private->server ) free( rtsp->p_private->server );
+          free( rtsp->p_private->server );
           rtsp->p_private->server = buf;
       }
       if( !strncasecmp( answer, "Session:", 8 ) )
@@ -559,12 +559,12 @@ void rtsp_close( rtsp_client_t *rtsp )
         rtsp->pf_disconnect( rtsp->p_userdata );
     }
 
-    if( rtsp->p_private->path ) free( rtsp->p_private->path );
-    if( rtsp->p_private->host ) free( rtsp->p_private->host );
-    if( rtsp->p_private->mrl ) free( rtsp->p_private->mrl );
-    if( rtsp->p_private->session ) free( rtsp->p_private->session );
-    if( rtsp->p_private->user_agent ) free( rtsp->p_private->user_agent );
-    if( rtsp->p_private->server ) free( rtsp->p_private->server );
+    free( rtsp->p_private->path );
+    free( rtsp->p_private->host );
+    free( rtsp->p_private->mrl );
+    free( rtsp->p_private->session );
+    free( rtsp->p_private->user_agent );
+    free( rtsp->p_private->server );
     rtsp_free_answers( rtsp );
     rtsp_unschedule_all( rtsp );
     free( rtsp->p_private );
@@ -604,7 +604,7 @@ char *rtsp_search_answers( rtsp_client_t *rtsp, const char *tag )
 
 void rtsp_set_session( rtsp_client_t *rtsp, const char *id )
 {
-    if( rtsp->p_private->session ) free( rtsp->p_private->session );
+    free( rtsp->p_private->session );
     rtsp->p_private->session = strdup(id);
 }
 
@@ -647,7 +647,7 @@ void rtsp_unschedule_field( rtsp_client_t *rtsp, const char *string )
     {
       if( !strncmp(*ptr, string, strlen(string)) ) break;
     }
-    if( *ptr ) free( *ptr );
+    free( *ptr );
     ptr++;
     do
     {
index 7cb36896ef54e1a77e81b0add12929ab025ec0ed..b14629c58debf17f0e22031f1ed890bfaee50eb5 100644 (file)
@@ -188,11 +188,11 @@ static int Open( vlc_object_t *p_this )
      * smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]] */
 
     if( !psz_user ) psz_user = var_CreateGetString( p_access, "smb-user" );
-    if( psz_user && !*psz_user ) { free( psz_user ); psz_user = 0; }
+    if( !*psz_user ) { free( psz_user ); psz_user = 0; }
     if( !psz_pwd ) psz_pwd = var_CreateGetString( p_access, "smb-pwd" );
-    if( psz_pwd && !*psz_pwd ) { free( psz_pwd ); psz_pwd = 0; }
+    if( !*psz_pwd ) { free( psz_pwd ); psz_pwd = 0; }
     if(!psz_domain) psz_domain = var_CreateGetString( p_access, "smb-domain" );
-    if( psz_domain && !*psz_domain ) { free( psz_domain ); psz_domain = 0; }
+    if( !*psz_domain ) { free( psz_domain ); psz_domain = 0; }
 
 #ifdef WIN32
     if( psz_user )
@@ -208,9 +208,9 @@ static int Open( vlc_object_t *p_this )
         asprintf( &psz_uri, "smb://%s", psz_path );
 #endif
 
-    if( psz_user ) free( psz_user );
-    if( psz_pwd ) free( psz_pwd );
-    if( psz_domain ) free( psz_domain );
+    free( psz_user );
+    free( psz_pwd );
+    free( psz_domain );
 
 #ifdef USE_CTX
     if( !(p_smb = smbc_new_context()) )
index 2a600b94376a3f58678aac5e7b52bd635c39755c..e6b9d23f0f4c571fb7f342f0e7aa59a6fbccf4c7 100644 (file)
@@ -431,14 +431,14 @@ static int Open( vlc_object_t *p_this )
             p_sys->fd_audio = OpenAudioDev( p_demux, p_sys->psz_device );
             if( p_sys->fd_audio >= 0 )
             {
-                if( p_sys->psz_adev ) free( p_sys->psz_adev );
+                free( p_sys->psz_adev );
                 p_sys->psz_adev = p_sys->psz_device;
                 p_sys->psz_device = NULL;
             }
         }
         else
         {
-            if( p_sys->psz_vdev ) free( p_sys->psz_vdev );
+            free( p_sys->psz_vdev );
             p_sys->psz_vdev = p_sys->psz_device;
             p_sys->psz_device = NULL;
         }
@@ -459,7 +459,7 @@ static int Open( vlc_object_t *p_this )
     {
         if( !p_sys->psz_vdev || !*p_sys->psz_vdev )
         {
-            if( p_sys->psz_vdev ) free( p_sys->psz_vdev );
+            free( p_sys->psz_vdev );
             p_sys->psz_vdev = var_CreateGetString( p_demux, "v4l-vdev" );;
         }
 
@@ -474,7 +474,7 @@ static int Open( vlc_object_t *p_this )
     {
         if( !p_sys->psz_adev || !*p_sys->psz_adev )
         {
-            if( p_sys->psz_adev ) free( p_sys->psz_adev );
+            free( p_sys->psz_adev );
             p_sys->psz_adev = var_CreateGetString( p_demux, "v4l-adev" );;
         }
 
@@ -548,9 +548,9 @@ static void Close( vlc_object_t *p_this )
     demux_t     *p_demux = (demux_t *)p_this;
     demux_sys_t *p_sys   = p_demux->p_sys;
 
-    if( p_sys->psz_device ) free( p_sys->psz_device );
-    if( p_sys->psz_vdev )   free( p_sys->psz_vdev );
-    if( p_sys->psz_adev )   free( p_sys->psz_adev );
+    free( p_sys->psz_device );
+    free( p_sys->psz_vdev );
+    free( p_sys->psz_adev );
     if( p_sys->fd_video >= 0 ) close( p_sys->fd_video );
     if( p_sys->fd_audio >= 0 ) close( p_sys->fd_audio );
     if( p_sys->p_block_audio ) block_Release( p_sys->p_block_audio );
@@ -866,7 +866,7 @@ static void ParseMRL( demux_t *p_demux )
     {
         p_sys->psz_device = strdup( psz_dup );
     }
-    if( psz_dup ) free( psz_dup );
+    free( psz_dup );
 }
 
 /*****************************************************************************
index 4ce3d0d136a4ca384a0e790415b099ff9557e69f..4762a1b9fe618127171c40766c9186b87476bc6c 100644 (file)
@@ -610,7 +610,7 @@ static int FindMainDevice( vlc_object_t *p_this, demux_sys_t *p_sys,
             {
                 msg_Dbg( p_this, "'%s' is a video device", p_sys->psz_device );
                 /* Device was a video device */
-                if( p_sys->psz_vdev ) free( p_sys->psz_vdev );
+                free( p_sys->psz_vdev );
                 p_sys->psz_vdev = p_sys->psz_device;
                 p_sys->psz_device = NULL;
                 p_sys->i_fd_video = OpenVideoDev( p_this, p_sys, b_demux );
@@ -653,7 +653,7 @@ static int FindMainDevice( vlc_object_t *p_this, demux_sys_t *p_sys,
     {
         if( !p_sys->psz_vdev || !*p_sys->psz_vdev )
         {
-            if( p_sys->psz_vdev ) free( p_sys->psz_vdev );
+            free( p_sys->psz_vdev );
             p_sys->psz_vdev = var_CreateGetString( p_this, "v4l2-dev" );
         }
 
@@ -862,7 +862,7 @@ static void ParseMRL( demux_sys_t *p_sys, char *psz_path, vlc_object_t *p_obj )
                     i_len = strlen( psz_parser );
                 }
 
-                if( p_sys->psz_requested_chroma ) free( p_sys->psz_requested_chroma );
+                free( p_sys->psz_requested_chroma );
                 p_sys->psz_requested_chroma = strndup( psz_parser, i_len );
 
                 psz_parser += i_len;
@@ -1053,7 +1053,7 @@ static void ParseMRL( demux_sys_t *p_sys, char *psz_path, vlc_object_t *p_obj )
     {
         p_sys->psz_device = strdup( psz_dup );
     }
-    if( psz_dup ) free( psz_dup );
+    free( psz_dup );
 }
 
 /*****************************************************************************
index 95e5c49a7f496575e77ed2debc0cbdc02b61527a..9eaa93924c61e8a4fabc9038d961e6105532430b 100644 (file)
@@ -162,7 +162,7 @@ vcddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
  *****************************************************************************/
 void ioctl_Close( vlc_object_t * p_this, vcddev_t *p_vcddev )
 {
-    if( p_vcddev->psz_dev ) free( p_vcddev->psz_dev );
+    free( p_vcddev->psz_dev );
 
     if( p_vcddev->i_vcdimage_handle != -1 )
     {
@@ -358,8 +358,8 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
 
                 if( *pp_sectors == NULL || p_fulltoc == NULL )
                 {
-                    if( *pp_sectors ) free( *pp_sectors );
-                    if( p_fulltoc ) free( p_fulltoc );
+                    free( *pp_sectors );
+                    free( p_fulltoc );
                     msg_Err( p_this, "out of memory" );
                     CloseHandle( hEvent );
                     return 0;
@@ -972,8 +972,8 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
 
 error:
     if( cuefile ) fclose( cuefile );
-    if( psz_cuefile ) free( psz_cuefile );
-    if( psz_vcdfile ) free( psz_vcdfile );
+    free( psz_cuefile );
+    free( psz_vcdfile );
 
     return i_ret;
 }
@@ -988,8 +988,7 @@ static void CloseVCDImage( vlc_object_t * p_this, vcddev_t *p_vcddev )
     else
         return;
 
-    if( p_vcddev->p_sectors )
-        free( p_vcddev->p_sectors );
+    free( p_vcddev->p_sectors );
 }
 
 #if defined( __APPLE__ )
index e7b760b1118a4a8356890da4a11e6fabb11b7cba..28c531e95e1a231d2c22544ffa93cc0a68b5f3da 100644 (file)
@@ -243,7 +243,7 @@ static void Close( vlc_object_t *p_this )
 
     if( p_sys )
     {
-        if( p_sys->p_last) free( p_sys->p_last );
+        free( p_sys->p_last );
         free( p_sys );
     }
 }