]> git.sesse.net Git - vlc/commitdiff
stream_out_rtp: fix potential memleak (#2447)
authorRémi Duraffort <ivoire@videolan.org>
Mon, 26 Jan 2009 14:59:55 +0000 (15:59 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 26 Jan 2009 15:07:01 +0000 (16:07 +0100)
modules/stream_out/rtp.c

index 09cf1c961e1e51086640ea1b0d4390d765980d6d..9c572166e78b39c2f23ceee86d99f82fc37f6cae 100644 (file)
@@ -350,13 +350,15 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_port       = var_GetInteger( p_stream, SOUT_CFG_PREFIX "port" );
     p_sys->i_port_audio = var_GetInteger( p_stream, SOUT_CFG_PREFIX "port-audio" );
     p_sys->i_port_video = var_GetInteger( p_stream, SOUT_CFG_PREFIX "port-video" );
-    p_sys->rtcp_mux   = var_GetBool( p_stream, SOUT_CFG_PREFIX "rtcp-mux" );
+    p_sys->rtcp_mux     = var_GetBool( p_stream, SOUT_CFG_PREFIX "rtcp-mux" );
 
     p_sys->psz_sdp_file = NULL;
 
     if( p_sys->i_port_audio && p_sys->i_port_video == p_sys->i_port_audio )
     {
         msg_Err( p_stream, "audio and video RTP port must be distinct" );
+        free( p_sys->psz_destination );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 
@@ -469,6 +471,7 @@ static int Open( vlc_object_t *p_this )
             free( psz );
             vlc_mutex_destroy( &p_sys->lock_sdp );
             vlc_mutex_destroy( &p_sys->lock_es );
+            free( p_sys->psz_destination );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -483,6 +486,7 @@ static int Open( vlc_object_t *p_this )
             sout_AccessOutDelete( p_sys->p_grab );
             vlc_mutex_destroy( &p_sys->lock_sdp );
             vlc_mutex_destroy( &p_sys->lock_es );
+            free( p_sys->psz_destination );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -494,6 +498,7 @@ static int Open( vlc_object_t *p_this )
             sout_AccessOutDelete( p_sys->p_grab );
             vlc_mutex_destroy( &p_sys->lock_sdp );
             vlc_mutex_destroy( &p_sys->lock_es );
+            free( p_sys->psz_destination );
             free( p_sys );
             return VLC_EGENERIC;
         }