From: Christophe Mutricy Date: Sat, 29 Mar 2008 00:06:11 +0000 (+0000) Subject: Avoid memleak and use of uninitiliazed pointer X-Git-Tag: 0.9.0-test0~1769 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4e976a6e0f356e0c1ce576461bb54f65dd42392f;p=vlc Avoid memleak and use of uninitiliazed pointer --- diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c index 041ce0d28b..c318f018a3 100644 --- a/modules/stream_out/standard.c +++ b/modules/stream_out/standard.c @@ -164,7 +164,7 @@ static int Open( vlc_object_t *p_this ) char *psz_mux; char *psz_access; - char *psz_url; + char *psz_url=NULL; char *psz_bind; char *psz_path; @@ -203,8 +203,13 @@ static int Open( vlc_object_t *p_this ) } var_Get( p_stream, SOUT_CFG_PREFIX "dst", &val ); - if( *val.psz_string ) psz_url = val.psz_string; - if( !*val.psz_string ) free( val.psz_string ); + if( *val.psz_string ) + { + free( psz_url); + psz_url = val.psz_string; + } + else + free( val.psz_string ); p_sys = p_stream->p_sys = malloc( sizeof( sout_stream_sys_t) ); if( !p_sys ) return VLC_ENOMEM;