summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/hoststated/hoststated.c7
-rw-r--r--usr.sbin/relayd/relayd.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/hoststated.c b/usr.sbin/hoststated/hoststated.c
index 07d90212c22..f48ba94e18c 100644
--- a/usr.sbin/hoststated/hoststated.c
+++ b/usr.sbin/hoststated/hoststated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hoststated.c,v 1.25 2007/05/29 00:21:10 pyr Exp $ */
+/* $OpenBSD: hoststated.c,v 1.26 2007/05/29 00:58:06 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -342,6 +342,7 @@ purge_config(struct hoststated *env, u_int8_t what)
struct protocol *proto;
struct protonode *pnode;
struct relay *rly;
+ struct session *sess;
if (what & PURGE_SERVICES) {
while ((service = TAILQ_FIRST(&env->services)) != NULL) {
@@ -357,6 +358,10 @@ purge_config(struct hoststated *env, u_int8_t what)
if (what & PURGE_RELAYS) {
while ((rly = TAILQ_FIRST(&env->relays)) != NULL) {
TAILQ_REMOVE(&env->relays, rly, entry);
+ while ((sess = TAILQ_FIRST(&rly->sessions)) != NULL) {
+ TAILQ_REMOVE(&rly->sessions, sess, entry);
+ free(sess);
+ }
if (rly->bev != NULL)
bufferevent_free(rly->bev);
if (rly->dstbev != NULL)
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index 94a938c74ea..9f20b1a90b1 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.25 2007/05/29 00:21:10 pyr Exp $ */
+/* $OpenBSD: relayd.c,v 1.26 2007/05/29 00:58:06 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -342,6 +342,7 @@ purge_config(struct hoststated *env, u_int8_t what)
struct protocol *proto;
struct protonode *pnode;
struct relay *rly;
+ struct session *sess;
if (what & PURGE_SERVICES) {
while ((service = TAILQ_FIRST(&env->services)) != NULL) {
@@ -357,6 +358,10 @@ purge_config(struct hoststated *env, u_int8_t what)
if (what & PURGE_RELAYS) {
while ((rly = TAILQ_FIRST(&env->relays)) != NULL) {
TAILQ_REMOVE(&env->relays, rly, entry);
+ while ((sess = TAILQ_FIRST(&rly->sessions)) != NULL) {
+ TAILQ_REMOVE(&rly->sessions, sess, entry);
+ free(sess);
+ }
if (rly->bev != NULL)
bufferevent_free(rly->bev);
if (rly->dstbev != NULL)