Commit 1984f60b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix VLM double free

Pointed-out-by: Sébastien Escudier
(cherry picked from commit b4329926)
parent c8764017
...@@ -199,12 +199,10 @@ void libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, char *psz_name, ...@@ -199,12 +199,10 @@ void libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, char *psz_name,
for( n = 0; n < i_options; n++ ) for( n = 0; n < i_options; n++ )
TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) ); TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
if( vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL ) ) n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
{
vlm_media_Clean( &m ); vlm_media_Clean( &m );
if( n )
libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name ); libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
}
vlm_media_Clean( &m );
#else #else
libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." ); libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -233,12 +231,10 @@ void libvlc_vlm_add_vod( libvlc_instance_t *p_instance, char *psz_name, ...@@ -233,12 +231,10 @@ void libvlc_vlm_add_vod( libvlc_instance_t *p_instance, char *psz_name,
for( n = 0; n < i_options; n++ ) for( n = 0; n < i_options; n++ )
TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) ); TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
if( vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL ) ) n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
{
vlm_media_Clean( &m ); vlm_media_Clean( &m );
if( n )
libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name ); libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
}
vlm_media_Clean( &m );
#else #else
libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." ); libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
return VLC_EGENERIC; return VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment