[vlc-devel] commit: lua: fix object leak. ( Rémi Duraffort )

git version control git at videolan.org
Thu Feb 11 15:57:21 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Feb 11 15:45:19 2010 +0100| [4b7fc754de0be8e0cb613bf44f08a1cc740ba761] | committer: Rémi Duraffort 

lua: fix object leak.

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

 modules/misc/lua/libs/video.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/misc/lua/libs/video.c b/modules/misc/lua/libs/video.c
index c1c023d..96d0325 100644
--- a/modules/misc/lua/libs/video.c
+++ b/modules/misc/lua/libs/video.c
@@ -54,10 +54,14 @@ static int vlclua_fullscreen( lua_State *L )
     if( !p_input ) return vlclua_error( L );
 
     p_vout = input_GetVout( p_input );
-    if( !p_vout ) return vlclua_error( L );
-#warning ^^ How about releasing the input?
+    if( !p_vout )
+    {
+        vlc_object_release( p_input );
+        return vlclua_error( L );
+    }
 
     i_ret = vlclua_var_toggle_or_set( L, p_vout, "fullscreen" );
+
     vlc_object_release( p_vout );
     vlc_object_release( p_input );
     return i_ret;




More information about the vlc-devel mailing list