[vlc-devel] commit: Fix potential memleak. ( Rémi Duraffort )

git version control git at videolan.org
Wed Aug 20 20:10:49 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 20 19:39:17 2008 +0200| [24adfd982d2cf6693245d77cf6877ea2c0aa8141] | committer: Rémi Duraffort 

Fix potential memleak.

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

 modules/access_filter/timeshift.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/access_filter/timeshift.c b/modules/access_filter/timeshift.c
index b90e261..086a96a 100644
--- a/modules/access_filter/timeshift.c
+++ b/modules/access_filter/timeshift.c
@@ -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;
     }




More information about the vlc-devel mailing list