1
0
forked from pool/strongswan
strongswan/strongswan_crash_badcfg_reload.dif

22 lines
652 B
Plaintext

--- src/starter/starter.c
+++ src/starter/starter.c 2008/05/20 08:42:39
@@ -390,7 +390,7 @@
);
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
@@ -484,7 +484,8 @@
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);