[vlc-devel] commit: vcd: fix potential NULL-dereference ( found with cocinnelle static analyser). ( Rémi Duraffort )

git version control git at videolan.org
Mon Feb 8 22:25:47 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Feb  8 12:21:36 2010 +0100| [583ea37e5f9af2c88f3fca215c06c1a6be424cec] | committer: Rémi Duraffort 

vcd: fix potential NULL-dereference (found with cocinnelle static analyser).

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

 modules/access/vcd/vcd.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c
index dfe281a..0b62bc2 100644
--- a/modules/access/vcd/vcd.c
+++ b/modules/access/vcd/vcd.c
@@ -136,12 +136,10 @@ static int Open( vlc_object_t *p_this )
 #endif
 
     /* Open VCD */
-    if( !(vcddev = ioctl_Open( p_this, psz_dup )) )
-    {
-        free( psz_dup );
-        return VLC_EGENERIC;
-    }
+    vcddev = ioctl_Open( p_this, psz_dup );
     free( psz_dup );
+    if( !vcddev )
+        return VLC_EGENERIC;
 
     /* Set up p_access */
     p_access->pf_read = NULL;
@@ -218,7 +216,7 @@ static int Open( vlc_object_t *p_this )
     return VLC_SUCCESS;
 
 error:
-    ioctl_Close( VLC_OBJECT(p_access), p_sys->vcddev );
+    ioctl_Close( VLC_OBJECT(p_access), vcddev );
     free( p_sys );
     return VLC_EGENERIC;
 }




More information about the vlc-devel mailing list