Commit 4302a6f7 authored by Rémi Duraffort's avatar Rémi Duraffort

logger: fix use after free

parent 8dfb239f
...@@ -301,13 +301,14 @@ static int Open( vlc_object_t *p_this ) ...@@ -301,13 +301,14 @@ static int Open( vlc_object_t *p_this )
/* Open the log file and remove any buffering for the stream */ /* Open the log file and remove any buffering for the stream */
msg_Dbg( p_intf, "opening logfile `%s'", filename ); msg_Dbg( p_intf, "opening logfile `%s'", filename );
p_sys->p_file = vlc_fopen( filename, "at" ); p_sys->p_file = vlc_fopen( filename, "at" );
free( psz_file );
if( p_sys->p_file == NULL ) if( p_sys->p_file == NULL )
{ {
msg_Err( p_intf, "error opening logfile `%s': %m", filename ); msg_Err( p_intf, "error opening logfile `%s': %m", filename );
free( psz_file );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
free( psz_file );
setvbuf( p_sys->p_file, NULL, _IONBF, 0 ); setvbuf( p_sys->p_file, NULL, _IONBF, 0 );
fputs( header, p_sys->p_file ); fputs( header, p_sys->p_file );
} }
......
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