Don't overwrite myadmin/myemal with "undefined-something"
when reading config - only replace the existing values if new values were successfully read from configuration file. Set new_mycall to NULL after freeing it to avoid double-free, so that we won't crash on the second reconfiguration. git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@220 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
This commit is contained in:
parent
b4309a525e
commit
0e81f59e7c
|
|
@ -531,9 +531,6 @@ int read_config(void)
|
|||
int failed = 0;
|
||||
char *s;
|
||||
|
||||
myadmin = hstrdup("undefined-myadmin");
|
||||
myemail = hstrdup("undefined-myemail");
|
||||
|
||||
if (read_cfgfile(cfgfile, cfg_cmds))
|
||||
return -1;
|
||||
|
||||
|
|
@ -561,10 +558,10 @@ int read_config(void)
|
|||
|
||||
/* mycall is only applied when running for the first time. */
|
||||
if (mycall) {
|
||||
if (new_mycall && strcasecmp(new_mycall, mycall)) {
|
||||
if (new_mycall && strcasecmp(new_mycall, mycall) != 0)
|
||||
hlog(LOG_WARNING, "Config: Not changing mycall while running.");
|
||||
}
|
||||
hfree(new_mycall);
|
||||
new_mycall = NULL;
|
||||
} else {
|
||||
if (!new_mycall) {
|
||||
hlog(LOG_CRIT, "Config: mycall is not defined.");
|
||||
|
|
@ -614,8 +611,6 @@ int read_config(void)
|
|||
hlog(LOG_INFO, "After configuration FileLimit is %d", fileno_limit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (workers_configured < 1) {
|
||||
hlog(LOG_WARNING, "Configured less than 1 worker threads. Using 1.");
|
||||
} else if (workers_configured > 32) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue