From 6b90843041ecdf3ae0bde9ce27a1d8327de56f48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Thu, 31 Jul 2008 15:50:47 +0200 Subject: [PATCH] Fix memleaks in stream output. --- modules/stream_out/standard.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c index 72b97e73f1..a7c5d24904 100644 --- a/modules/stream_out/standard.c +++ b/modules/stream_out/standard.c @@ -217,7 +217,11 @@ static int Open( vlc_object_t *p_this ) free( val.psz_string ); p_sys = p_stream->p_sys = malloc( sizeof( sout_stream_sys_t) ); - if( !p_sys ) return VLC_ENOMEM; + if( !p_sys ) + { + free( psz_url ); + return VLC_ENOMEM; + } p_stream->p_sys->p_session = NULL; msg_Dbg( p_this, "creating `%s/%s://%s'", psz_access, psz_mux, psz_url ); @@ -278,6 +282,7 @@ static int Open( vlc_object_t *p_this ) else { msg_Err( p_stream, "no access _and_ no muxer (fatal error)" ); + free( psz_url ); free( p_sys ); return VLC_EGENERIC; } @@ -370,6 +375,7 @@ static int Open( vlc_object_t *p_this ) psz_access, psz_mux, psz_url ); free( psz_access ); free( psz_mux ); + free( psz_url ); free( p_sys ); return VLC_EGENERIC; } @@ -385,6 +391,7 @@ static int Open( vlc_object_t *p_this ) sout_AccessOutDelete( p_access ); free( psz_access ); free( psz_mux ); + free( psz_url ); free( p_sys ); return VLC_EGENERIC; } -- 2.39.2