[vlc-devel] commit: Lua SD: fix another obvious leak ( Jean-Philippe André )

git version control git at videolan.org
Mon Feb 8 18:43:58 CET 2010


vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Mon Feb  8 18:39:42 2010 +0100| [23e13928607c4366e769b0e54f062feca67832d7] | committer: Jean-Philippe André 

Lua SD: fix another obvious leak

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

 modules/misc/lua/libs/sd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/misc/lua/libs/sd.c b/modules/misc/lua/libs/sd.c
index 8460691..c2e68e3 100644
--- a/modules/misc/lua/libs/sd.c
+++ b/modules/misc/lua/libs/sd.c
@@ -118,10 +118,10 @@ static int vlclua_sd_add_node( lua_State *L )
         lua_getfield( L, -1, "title" );
         if( lua_isstring( L, -1 ) )
         {
-            input_item_t *p_input = input_item_New( p_sd,
-                                                    "vlc://nop",
-                                                    lua_tostring( L, -1 ) );
+            char *name = strdup( lua_tostring( L, -1 ) );
             lua_pop( L, 1 );
+            input_item_t *p_input = input_item_New( p_sd, "vlc://nop", name );
+            free( name );
             lua_getfield( L, -1, "arturl" );
             if( lua_isstring( L, -1 ) )
             {




More information about the vlc-devel mailing list