From: RĂ©mi Duraffort Date: Mon, 8 Feb 2010 11:21:36 +0000 (+0100) Subject: vcd: fix potential NULL-dereference (found with cocinnelle static analyser). X-Git-Tag: 1.1.0-ff~268 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=583ea37e5f9af2c88f3fca215c06c1a6be424cec;p=vlc vcd: fix potential NULL-dereference (found with cocinnelle static analyser). --- diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c index dfe281a60a..0b62bc2592 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; }