Commit 583ea37e authored by Rémi Duraffort's avatar Rémi Duraffort

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

parent 09d5f89c
...@@ -136,12 +136,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -136,12 +136,10 @@ static int Open( vlc_object_t *p_this )
#endif #endif
/* Open VCD */ /* Open VCD */
if( !(vcddev = ioctl_Open( p_this, psz_dup )) ) vcddev = ioctl_Open( p_this, psz_dup );
{
free( psz_dup );
return VLC_EGENERIC;
}
free( psz_dup ); free( psz_dup );
if( !vcddev )
return VLC_EGENERIC;
/* Set up p_access */ /* Set up p_access */
p_access->pf_read = NULL; p_access->pf_read = NULL;
...@@ -218,7 +216,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -218,7 +216,7 @@ static int Open( vlc_object_t *p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
ioctl_Close( VLC_OBJECT(p_access), p_sys->vcddev ); ioctl_Close( VLC_OBJECT(p_access), vcddev );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment