summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.c
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-11-14 10:59:02 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-11-14 10:59:02 +0000
commitc0e74004feb6a3713eb241fb02211f7fa4b93360 (patch)
tree921036ac641156778de6071530a49dbeaf1972d3 /usr.sbin/relayd/relayd.c
parent2c181cafdd1839d2b9195326972e957d1234a73d (diff)
make protos dynamic too
Diffstat (limited to 'usr.sbin/relayd/relayd.c')
-rw-r--r--usr.sbin/relayd/relayd.c9
1 files changed, 5 insertions, 4 deletions
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 <pyr@openbsd.org>
@@ -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);
}
}