]> git.sesse.net Git - vlc/commitdiff
vcd: fix potential NULL-dereference (found with cocinnelle static analyser).
authorRémi Duraffort <ivoire@videolan.org>
Mon, 8 Feb 2010 11:21:36 +0000 (12:21 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 8 Feb 2010 21:25:38 +0000 (22:25 +0100)
modules/access/vcd/vcd.c

index dfe281a60aee1a8f9afe7761aadccb8dcefa2026..0b62bc2592ea89c7a97d991a9a8a5a7fbee14861 100644 (file)
@@ -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;
 }