[vlc-devel] commit: Extensions: fix leak: free commands ( Jean-Philippe André )
git version control
git at videolan.org
Thu Feb 4 03:33:11 CET 2010
vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Thu Feb 4 03:29:37 2010 +0100| [c235fa52c1ecc0b085dced0879a8c5a10bbfc97f] | committer: Jean-Philippe André
Extensions: fix leak: free commands
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c235fa52c1ecc0b085dced0879a8c5a10bbfc97f
---
modules/misc/lua/extension_thread.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/misc/lua/extension_thread.c b/modules/misc/lua/extension_thread.c
index 638b966..cadfc3a 100644
--- a/modules/misc/lua/extension_thread.c
+++ b/modules/misc/lua/extension_thread.c
@@ -285,6 +285,7 @@ static void* Run( void *data )
if( cmd )
{
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 );
@@ -346,7 +347,6 @@ static void* Run( void *data )
msg_Dbg( p_mgr, "Trigger menu %d of '%s'",
*pi_id, p_ext->psz_name );
lua_ExtensionTriggerMenu( p_mgr, p_ext, *pi_id );
- free( pi_id );
break;
}
@@ -373,6 +373,8 @@ static void* Run( void *data )
}
}
+ FreeCommands( cmd );
+
vlc_mutex_lock( &p_ext->p_sys->command_lock );
if( !p_ext->p_sys->b_exiting && !p_ext->p_sys->command )
{
More information about the vlc-devel
mailing list