Commit c235fa52 authored by Jean-Philippe André's avatar Jean-Philippe André

Extensions: fix leak: free commands

parent 2e028db6
...@@ -285,6 +285,7 @@ static void* Run( void *data ) ...@@ -285,6 +285,7 @@ static void* Run( void *data )
if( cmd ) if( cmd )
{ {
p_ext->p_sys->command = cmd->next; p_ext->p_sys->command = cmd->next;
cmd->next = NULL; // This prevents FreeCommands from freeing next
} }
vlc_mutex_unlock( &p_ext->p_sys->command_lock ); vlc_mutex_unlock( &p_ext->p_sys->command_lock );
...@@ -346,7 +347,6 @@ static void* Run( void *data ) ...@@ -346,7 +347,6 @@ static void* Run( void *data )
msg_Dbg( p_mgr, "Trigger menu %d of '%s'", msg_Dbg( p_mgr, "Trigger menu %d of '%s'",
*pi_id, p_ext->psz_name ); *pi_id, p_ext->psz_name );
lua_ExtensionTriggerMenu( p_mgr, p_ext, *pi_id ); lua_ExtensionTriggerMenu( p_mgr, p_ext, *pi_id );
free( pi_id );
break; break;
} }
...@@ -373,6 +373,8 @@ static void* Run( void *data ) ...@@ -373,6 +373,8 @@ static void* Run( void *data )
} }
} }
FreeCommands( cmd );
vlc_mutex_lock( &p_ext->p_sys->command_lock ); vlc_mutex_lock( &p_ext->p_sys->command_lock );
if( !p_ext->p_sys->b_exiting && !p_ext->p_sys->command ) if( !p_ext->p_sys->b_exiting && !p_ext->p_sys->command )
{ {
......
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