diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-07-02 05:51:49 +0000 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-07-02 05:51:49 +0000 |
commit | 1dec30625e22e54fb0f28d2335bffca59f91ec98 (patch) | |
tree | d0dd8ffe2899f9ea4f91625ed6e78cb8397b31f1 | |
parent | 4ddd73351c7cc2e39627fd004d3e938333b6603a (diff) | |
download | strongswan-1dec30625e22e54fb0f28d2335bffca59f91ec98.tar.bz2 strongswan-1dec30625e22e54fb0f28d2335bffca59f91ec98.tar.xz |
check if parsing of ipsec update was successful
-rw-r--r-- | src/starter/confread.c | 3 | ||||
-rw-r--r-- | src/starter/starter.c | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/starter/confread.c b/src/starter/confread.c index 3794992e7..914024dca 100644 --- a/src/starter/confread.c +++ b/src/starter/confread.c @@ -931,8 +931,9 @@ confread_load(const char *file) /* load IPSec configuration file */ cfgp = parser_load_conf(file); if (!cfgp) + { return NULL; - + } cfg = (starter_config_t *)alloc_thing(starter_config_t, "starter_config_t"); /* set default values */ diff --git a/src/starter/starter.c b/src/starter/starter.c index ff042e246..ad78d14d4 100644 --- a/src/starter/starter.c +++ b/src/starter/starter.c @@ -452,7 +452,7 @@ int main (int argc, char **argv) ); new_cfg = confread_load(CONFIG_FILE); - if (new_cfg->err + new_cfg->non_fatal_err == 0) + if (new_cfg && (new_cfg->err + new_cfg->non_fatal_err == 0)) { /* Switch to new config. New conn will be loaded below */ if (!starter_cmp_defaultroute(&new_cfg->defaultroute @@ -546,7 +546,10 @@ int main (int argc, char **argv) else { plog("can't reload config file due to errors -- keeping old one"); - confread_free(new_cfg); + if (new_cfg) + { + confread_free(new_cfg); + } } _action_ &= ~FLAG_ACTION_UPDATE; last_reload = time(NULL); |