vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <h...@beauzee.fr> | Tue Apr 
 3 12:09:57 2018 +0200| [4d98f7fbeb7f6a2fbdc637fb61ed9a6a31f0438f] | committer: 
Hugo Beauzée-Luyssen

lua: stream: Fix leak on error

(cherry picked from commit 7eda8499ef1c664d62a21047f25dd5a9581a81ff)
Signed-off-by: Hugo Beauzée-Luyssen <h...@beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4d98f7fbeb7f6a2fbdc637fb61ed9a6a31f0438f
---

 modules/lua/libs/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/lua/libs/stream.c b/modules/lua/libs/stream.c
index 9da67d4c41..2bb3e6ee96 100644
--- a/modules/lua/libs/stream.c
+++ b/modules/lua/libs/stream.c
@@ -232,6 +232,7 @@ static int vlclua_stream_readdir( lua_State *L )
         input_item_AddOption( p_input, "show-hiddenfiles",
                               VLC_INPUT_OPTION_TRUSTED );
     input_item_node_t *p_items = input_item_node_Create( p_input );
+    input_item_Release( p_input );
     if( !p_items )
         return vlclua_error( L );
     if ( vlc_stream_ReadDir( *pp_stream, p_items ) )
@@ -247,7 +248,6 @@ static int vlclua_stream_readdir( lua_State *L )
         lua_settable( L, -3 );
     }
     input_item_node_Delete( p_items );
-    input_item_Release( p_input );
     return 1;
 }
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to