]> git.sesse.net Git - vlc/commitdiff
Lua SD: fix another obvious leak
authorJean-Philippe André <jpeg@videolan.org>
Mon, 8 Feb 2010 17:39:42 +0000 (18:39 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Mon, 8 Feb 2010 17:40:27 +0000 (18:40 +0100)
modules/misc/lua/libs/sd.c

index 846069116f9727ec8ca823167c7a69a28e6f9711..c2e68e366d3a80a250bfa33636f7e25edb77070d 100644 (file)
@@ -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 ) )
             {