From c0e74004feb6a3713eb241fb02211f7fa4b93360 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Wed, 14 Nov 2007 10:59:02 +0000 Subject: make protos dynamic too --- usr.sbin/relayd/relayd.c | 9 +++++---- 1 file changed, 5 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 a5b35ee1aec..b0279d390b3 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.48 2007/11/13 10:35:21 pyr Exp $ */ +/* $OpenBSD: relayd.c,v 1.49 2007/11/14 10:59:01 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard @@ -492,9 +492,9 @@ purge_config(struct hoststated *env, u_int8_t what) free(env->relays); } - if (what & PURGE_PROTOS) { - while ((proto = TAILQ_FIRST(&env->protos)) != NULL) { - TAILQ_REMOVE(&env->protos, proto, entry); + if (what & PURGE_PROTOS && env->protos != NULL) { + while ((proto = TAILQ_FIRST(env->protos)) != NULL) { + TAILQ_REMOVE(env->protos, proto, entry); if (proto == &env->proto_default) continue; while ((pnode = RB_ROOT(&proto->request_tree)) @@ -519,6 +519,7 @@ purge_config(struct hoststated *env, u_int8_t what) } free(proto); } + free(env->protos); } } -- cgit v1.2.3