[vlc-commits] logger: fix use after free
Rémi Duraffort
git at videolan.org
Wed Dec 11 20:15:07 CET 2013
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Dec 11 20:13:55 2013 +0100| [4302a6f717a5ed844294bff9b451935d3280bfe3] | committer: Rémi Duraffort
logger: fix use after free
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4302a6f717a5ed844294bff9b451935d3280bfe3
---
modules/misc/logger.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 104181e..202db98 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -301,13 +301,14 @@ static int Open( vlc_object_t *p_this )
/* Open the log file and remove any buffering for the stream */
msg_Dbg( p_intf, "opening logfile `%s'", filename );
p_sys->p_file = vlc_fopen( filename, "at" );
- free( psz_file );
if( p_sys->p_file == NULL )
{
msg_Err( p_intf, "error opening logfile `%s': %m", filename );
+ free( psz_file );
free( p_sys );
return VLC_EGENERIC;
}
+ free( psz_file );
setvbuf( p_sys->p_file, NULL, _IONBF, 0 );
fputs( header, p_sys->p_file );
}
More information about the vlc-commits
mailing list