Commit 123d0b1c authored by François Cartegnie's avatar François Cartegnie 🤞

access: dvb: scan: early fail/release psz_path

parent f6715694
......@@ -274,15 +274,20 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
msg_Dbg( p_scan->p_obj, "using satellite config file (%s)", psz_path );
FILE *f = vlc_fopen( psz_path, "r" );
if( !f )
{
msg_Err( p_scan->p_obj, "failed to open satellite file (%s)", psz_path );
free( p_scan->parameter.sat_info.psz_name );
free( psz_path );
return VLC_EGENERIC;
}
free( psz_path );
/* parse file */
if( f )
{
scan_dvbs_transponder_t *p_transponders = malloc( sizeof( scan_dvbs_transponder_t ) );
if( !p_transponders )
{
fclose( f );
free( psz_path );
return VLC_ENOMEM;
}
......@@ -322,18 +327,9 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
msg_Dbg( p_scan->p_obj, "parsed %d transponders from config", p_scan->i_transponders);
fclose( f );
p_scan->p_transponders = p_transponders;
}
else
{
msg_Err( p_scan->p_obj, "failed to open satellite file (%s)", psz_path );
free( p_scan->parameter.sat_info.psz_name );
free( psz_path );
return VLC_EGENERIC;
}
fclose( f );
free( p_scan->parameter.sat_info.psz_name );
free( psz_path );
}
if( p_scan->i_index < p_scan->i_transponders )
......
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