From c53044596d693602d2e0fe7be428bfa014289fe8 Mon Sep 17 00:00:00 2001 From: "Thordur I. Bjornsson" Date: Tue, 29 Jan 2008 17:36:09 +0000 Subject: 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@ --- usr.sbin/relayd/relayd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'usr.sbin/relayd/relayd.c') 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 @@ -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; } -- cgit v1.2.3