[vlc-devel] commit: Lua SD: fix leaking (Fabio Ritrovato )
git version control
git at videolan.org
Sun Feb 28 23:43:52 CET 2010
vlc | branch: master | Fabio Ritrovato <sephiroth87 at videolan.org> | Sun Feb 28 23:43:39 2010 +0100| [a3670b8f940206078bb51b4babe60e8a385c97e7] | committer: Fabio Ritrovato
Lua SD: fix leaking
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3670b8f940206078bb51b4babe60e8a385c97e7
---
modules/misc/lua/libs/sd.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/modules/misc/lua/libs/sd.c b/modules/misc/lua/libs/sd.c
index 85e1f59..facfbfb 100644
--- a/modules/misc/lua/libs/sd.c
+++ b/modules/misc/lua/libs/sd.c
@@ -189,6 +189,10 @@ static int vlclua_sd_add_item( lua_State *L )
lua_setfield( L, -2, "__metatable" );
}
lua_setmetatable( L, -2 );
+ vlc_gc_decref( p_input );
+ while( i_options > 0 )
+ free( ppsz_options[--i_options] );
+ free( ppsz_options );
}
else
msg_Err( p_sd, "vlc.sd.add_item: the \"path\" parameter can't be empty" );
@@ -254,6 +258,10 @@ static int vlclua_node_add_subitem( lua_State *L )
lua_setfield( L, -2, "__metatable" );
}
lua_setmetatable( L, -2 );
+ vlc_gc_decref( p_input );
+ while( i_options > 0 )
+ free( ppsz_options[--i_options] );
+ free( ppsz_options );
}
else
msg_Err( p_sd, "node:add_subitem: the \"path\" parameter can't be empty" );
More information about the vlc-devel
mailing list