[vlc-devel] commit: Fix VLM double free ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Sep 5 17:24:31 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Fri Sep  5 18:22:34 2008 +0300| [1984f60b18f50aa5e517f042afa3c02461cdc195] | committer: Rémi Denis-Courmont 

Fix VLM double free

Pointed-out-by: Sébastien Escudier
(cherry picked from commit b4329926538524a39773510144d2239c207c1a1b)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1984f60b18f50aa5e517f042afa3c02461cdc195
---

 src/control/vlm.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/control/vlm.c b/src/control/vlm.c
index 5fe5468..8e0f5fa 100644
--- a/src/control/vlm.c
+++ b/src/control/vlm.c
@@ -199,12 +199,10 @@ void libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, char *psz_name,
     for( n = 0; n < i_options; n++ )
         TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
 
-    if( vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL ) )
-    {
-        vlm_media_Clean( &m );
-        libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
-    }
+    n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
     vlm_media_Clean( &m );
+    if( n )
+        libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
 #else
     libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
     return VLC_EGENERIC;
@@ -233,12 +231,10 @@ void libvlc_vlm_add_vod( libvlc_instance_t *p_instance, char *psz_name,
     for( n = 0; n < i_options; n++ )
         TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
 
-    if( vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL ) )
-    {
-        vlm_media_Clean( &m );
-        libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
-    }
+    n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
     vlm_media_Clean( &m );
+    if( n )
+        libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
 #else
     libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
     return VLC_EGENERIC;




More information about the vlc-devel mailing list