[vlc-commits] lua: stream: Fix leak on error

Hugo Beauzée-Luyssen git at videolan.org
Thu Apr 5 10:26:00 CEST 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Apr  3 12:09:57 2018 +0200| [7eda8499ef1c664d62a21047f25dd5a9581a81ff] | committer: Hugo Beauzée-Luyssen

lua: stream: Fix leak on error

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

 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 db4b3501cc..ddb3f4b31c 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;
 }
 



More information about the vlc-commits mailing list