wmail: fixed memory leaks in skip-names.
This commit is contained in:
parent
6e48b4a431
commit
0fb61f1e49
|
@ -159,7 +159,7 @@ static void AddSenderToSkipList( char *sender )
|
||||||
for( i = 0; i < numNames; ++i )
|
for( i = 0; i < numNames; ++i )
|
||||||
newList[i] = config.skipNames[i];
|
newList[i] = config.skipNames[i];
|
||||||
|
|
||||||
newList[i] = strdup( sender );
|
newList[i] = sender;
|
||||||
newList[i+1] = NULL;
|
newList[i+1] = NULL;
|
||||||
free( config.skipNames );
|
free( config.skipNames );
|
||||||
config.skipNames = newList;
|
config.skipNames = newList;
|
||||||
|
@ -202,10 +202,11 @@ void ResetConfigStrings( void )
|
||||||
config.backgroundColor = NULL;
|
config.backgroundColor = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !( config.givenOptions & CL_CHECKSUMFILENAME )) {
|
/*
|
||||||
|
* No corresponding command-line option.
|
||||||
|
*/
|
||||||
free( config.checksumFileName );
|
free( config.checksumFileName );
|
||||||
config.checksumFileName = NULL;
|
config.checksumFileName = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if( !( config.givenOptions & CL_CMDONMAIL )) {
|
if( !( config.givenOptions & CL_CMDONMAIL )) {
|
||||||
free( config.cmdOnMail );
|
free( config.cmdOnMail );
|
||||||
|
@ -216,6 +217,18 @@ void ResetConfigStrings( void )
|
||||||
free( config.useX11Font );
|
free( config.useX11Font );
|
||||||
config.useX11Font = NULL;
|
config.useX11Font = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* No corresponding command-line option.
|
||||||
|
*/
|
||||||
|
if( config.skipNames != NULL )
|
||||||
|
{
|
||||||
|
char **n;
|
||||||
|
for( n = config.skipNames; *n; ++n )
|
||||||
|
free( *n );
|
||||||
|
free( config.skipNames );
|
||||||
|
config.skipNames = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PostProcessConfiguration( void )
|
static void PostProcessConfiguration( void )
|
||||||
|
|
Loading…
Reference in a new issue