]> git.sesse.net Git - vlc/commitdiff
* luaplaylist.c: Looks like stream_ReadLine results needs to be freed. (untested)
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 15 May 2007 15:21:32 +0000 (15:21 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 15 May 2007 15:21:32 +0000 (15:21 +0000)
modules/demux/playlist/luaplaylist.c

index b8b9a99aa4b8c1ac252cf71d34b9c1b8da09896a..241e9f2182f25bc195595a7bdbf49a20bb612ba9 100644 (file)
@@ -97,7 +97,15 @@ static int vlclua_readline( lua_State *p_state )
 {
     demux_t *p_demux = vlclua_get_demux( p_state );
     char *psz_line = stream_ReadLine( p_demux->s );
-    lua_pushstring( p_state, psz_line );
+    if( psz_line )
+    {
+        lua_pushstring( p_state, psz_line );
+        free( psz_line );
+    }
+    else
+    {
+        lua_pushnil( p_state );
+    }
     return 1;
 }