]> git.sesse.net Git - vlc/commitdiff
Fix potential memleak.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 20 Aug 2008 17:39:17 +0000 (19:39 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 20 Aug 2008 17:39:31 +0000 (19:39 +0200)
modules/access_filter/timeshift.c

index b90e26131028d32bfb1d8330f1e2309c669aabea..086a96a86337ee4c5789512e8ba372affd021eda 100644 (file)
@@ -160,6 +160,8 @@ static int Open( vlc_object_t *p_this )
     p_access->info = p_src->info;
 
     p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     /* */
     p_sys->p_fifo = block_FifoNew();
@@ -186,6 +188,7 @@ static int Open( vlc_object_t *p_this )
     if( vlc_thread_create( p_access, "timeshift thread", Thread,
                            VLC_THREAD_PRIORITY_LOW, false ) )
     {
+        Close( p_this );
         msg_Err( p_access, "cannot spawn timeshift access thread" );
         return VLC_EGENERIC;
     }