Commit 5cb4066e authored by Rémi Duraffort's avatar Rémi Duraffort

Useless test before a free()

parent ac5fe543
......@@ -54,10 +54,7 @@ int var_buffer_reinitwrite( var_buffer_t *p_buf, int i_default_size )
if( p_buf->i_size < i_default_size )
{
p_buf->i_size = i_default_size;
if( p_buf->p_data )
{
free( p_buf->p_data );
}
free( p_buf->p_data );
p_buf->p_data = malloc( p_buf->i_size );
}
if( !p_buf->p_data )
......@@ -151,10 +148,7 @@ void var_buffer_addUTF16( var_buffer_t *p_buf, const char *p_str )
void var_buffer_free( var_buffer_t *p_buf )
{
if( p_buf->p_data )
{
free( p_buf->p_data );
}
free( p_buf->p_data );
p_buf->i_data = 0;
p_buf->i_size = 0;
}
......
......@@ -226,8 +226,7 @@ void E_( MMSHClose )( access_t *p_access )
Stop( p_access );
if( p_sys->p_header )
free( p_sys->p_header );
free( p_sys->p_header );
vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url );
......@@ -732,8 +731,7 @@ static void GetHeader( access_t *p_access )
/* Read the asf header */
p_sys->i_header = 0;
if( p_sys->p_header )
free( p_sys->p_header );
free( p_sys->p_header );
p_sys->p_header = NULL;
for( ;; )
{
......
......@@ -1099,10 +1099,7 @@ static int mms_ParseCommand( access_t *p_access,
int i_length;
uint32_t i_id;
if( p_sys->p_cmd )
{
free( p_sys->p_cmd );
}
free( p_sys->p_cmd );
p_sys->i_cmd = i_data;
p_sys->p_cmd = malloc( i_data );
memcpy( p_sys->p_cmd, p_data, i_data );
......
......@@ -826,8 +826,7 @@ static int Open( vlc_object_t * p_this )
if( psz_device )
{
if( p_sys->psz_videodev )
free( p_sys->psz_videodev );
free( p_sys->psz_videodev );
p_sys->psz_videodev = psz_device;
}
......@@ -1061,10 +1060,8 @@ static void Close( vlc_object_t * p_this )
close( p_sys->i_fd );
if ( p_sys->i_radio_fd != -1 )
close( p_sys->i_radio_fd );
if ( p_sys->psz_videodev )
free( p_sys->psz_videodev );
if ( p_sys->psz_radiodev )
free( p_sys->psz_radiodev );
free( p_sys->psz_videodev );
free( p_sys->psz_radiodev );
free( p_sys );
}
......
......@@ -106,8 +106,8 @@ static void asmrp_dispose (asmrp_t *p) {
for (i=0; i<p->sym_tab_num; i++)
free (p->sym_tab[i].id);
if (p->buf) free (p->buf);
free (p);
free( p->buf );
free( p );
}
static void asmrp_getch (asmrp_t *p) {
......
......@@ -214,10 +214,7 @@ static int Open( vlc_object_t *p_this )
psz_out, psz_in );
}
}
if( pp_in_ports )
{
free( pp_in_ports );
}
free( pp_in_ports );
}
msg_Dbg( p_aout, "JACK audio output initialized (%d channels, buffer "
......@@ -233,14 +230,8 @@ error_out:
jack_deactivate( p_sys->p_jack_client );
jack_client_close( p_sys->p_jack_client );
}
if( p_sys->p_jack_ports )
{
free( p_sys->p_jack_ports );
}
if( p_sys->p_jack_buffers )
{
free( p_sys->p_jack_buffers );
}
free( p_sys->p_jack_ports );
free( p_sys->p_jack_buffers );
free( p_sys );
}
return status;
......
......@@ -334,8 +334,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
{
msg_Warn( p_dec, "can't get spu buffer" );
free( psz_subtitle );
if( psz_html )
free( psz_html );
free( psz_html );
return NULL;
}
......@@ -352,8 +351,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
{
msg_Err( p_dec, "cannot allocate SPU region" );
free( psz_subtitle );
if( psz_html )
free( psz_html );
free( psz_html );
p_dec->pf_spu_buffer_del( p_dec, p_spu );
return NULL;
}
......
......@@ -421,14 +421,14 @@ xtag_free (XTag * xtag)
if (xtag == NULL) return NULL;
if (xtag->name) free (xtag->name);
if (xtag->pcdata) free (xtag->pcdata);
free( xtag->name );
free( xtag->pcdata );
for (l = xtag->attributes; l; l = l->next) {
if ((attr = (XAttribute *)l->data) != NULL) {
if (attr->name) free (attr->name);
if (attr->value) free (attr->value);
free (attr);
free( attr->name );
free( attr->value );
free( attr );
}
}
xlist_free (xtag->attributes);
......
......@@ -434,7 +434,7 @@ static void Close( vlc_object_t *p_this )
decoder_sys_t *p_sys = p_dec->p_sys;
faacDecClose( p_sys->hfaad );
if( p_sys->p_buffer ) free( p_sys->p_buffer );
free( p_sys->p_buffer );
free( p_sys );
}
......
......@@ -225,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 )
{
......@@ -304,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 )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment