diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-01-29 17:36:09 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-01-29 17:36:09 +0000 |
commit | c53044596d693602d2e0fe7be428bfa014289fe8 (patch) | |
tree | 1811db78d33b669b5d6af92d1d303bcca27c4b35 /usr.sbin | |
parent | a7322c94cf8f645e958ca7e4d76a7c1444e64c4a (diff) |
When doing reconfigure() dont run a purge_config() on the
new_env if parse_config() fails, it's NULL and parse_config()
already freed it; Prevents segfaults when relayctl issues a
reload and there's a syntax error in the configuration file.
OK reyk@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/relayd/relayd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index c3a9504b8e2..7a6afba86f1 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.65 2007/12/10 20:31:56 pyr Exp $ */ +/* $OpenBSD: relayd.c,v 1.66 2008/01/29 17:36:08 thib Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -383,7 +383,7 @@ void reconfigure(void) { struct relayd *env = relayd_env; - struct relayd *new_env; + struct relayd *new_env = NULL; struct rdr *rdr; struct address *virt; struct table *table; @@ -391,8 +391,6 @@ reconfigure(void) log_info("reloading configuration"); if ((new_env = parse_config(env->confpath, env->opts)) == NULL) { - purge_config(new_env, PURGE_EVERYTHING); - free(new_env); log_warnx("configuration reloading FAILED"); return; } |