Commit 00d63f8f authored by Rémi Duraffort's avatar Rémi Duraffort

Cleaning (potential memleak and uneeded message).

parent 4fb56a1c
...@@ -78,8 +78,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump ) ...@@ -78,8 +78,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
if( ( p_dec->p_sys = p_sys = if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
{ {
msg_Err( p_dec, "out of memory" ); return VLC_ENOMEM;
return VLC_EGENERIC;
} }
snprintf( psz_file, sizeof( psz_file), "stream.%p", p_dec ); snprintf( psz_file, sizeof( psz_file), "stream.%p", p_dec );
...@@ -98,6 +97,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump ) ...@@ -98,6 +97,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
if( p_sys->i_fd == -1 ) if( p_sys->i_fd == -1 )
{ {
msg_Err( p_dec, "cannot create `%s'", psz_file ); msg_Err( p_dec, "cannot create `%s'", psz_file );
free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -164,8 +164,10 @@ void CloseDecoder ( vlc_object_t *p_this ) ...@@ -164,8 +164,10 @@ void CloseDecoder ( vlc_object_t *p_this )
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
#ifndef UNDER_CE #ifndef UNDER_CE
if( p_sys->i_fd >= 0 ) close( p_sys->i_fd ); if( p_sys->i_fd >= 0 )
close( p_sys->i_fd );
#endif #endif
free( p_sys ); free( p_sys );
} }
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