Commit 2f00cae9 authored by Rémi Duraffort's avatar Rémi Duraffort

dvb_scan: fix memleak.

parent 6b9c7f2a
...@@ -165,8 +165,6 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double ...@@ -165,8 +165,6 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
/* if there are no transponders in mem, laod from config file */ /* if there are no transponders in mem, laod from config file */
if( !*pi_count ) if( !*pi_count )
{ {
scan_dvbs_transponder_t *p_transponders = malloc( sizeof( scan_dvbs_transponder_t ) );
DIR *p_dir; DIR *p_dir;
char *psz_dir = NULL; char *psz_dir = NULL;
...@@ -223,6 +221,7 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double ...@@ -223,6 +221,7 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
/* parse file */ /* parse file */
if( f ) if( f )
{ {
scan_dvbs_transponder_t *p_transponders = malloc( sizeof( scan_dvbs_transponder_t ) );
char type; char type;
char psz_fec[3]; char psz_fec[3];
...@@ -256,6 +255,7 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double ...@@ -256,6 +255,7 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
msg_Dbg( p_scan->p_obj, "parsed %d transponders from config", *pi_count); msg_Dbg( p_scan->p_obj, "parsed %d transponders from config", *pi_count);
fclose( f ); fclose( f );
p_scan->parameter.sat_info.p_transponders = p_transponders;
} }
else else
{ {
...@@ -266,8 +266,6 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double ...@@ -266,8 +266,6 @@ static int ScanDvbSNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
} }
free( p_scan->parameter.sat_info.psz_name ); free( p_scan->parameter.sat_info.psz_name );
free( p_scan->parameter.sat_info.psz_path ); free( p_scan->parameter.sat_info.psz_path );
p_scan->parameter.sat_info.p_transponders = p_transponders;
} }
if( p_scan->i_index < *pi_count ) if( p_scan->i_index < *pi_count )
......
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