summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/exchange.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-08-22 07:09:04 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-08-22 07:09:04 +0000
commitb692457bcaa321d3b098506f0cf4e5cb57a7f6aa (patch)
treec085a7a34b457480668f242d825d73bf27c26de9 /sbin/isakmpd/exchange.c
parentfc82a13a4433e7f85cbbbaa39a3c20d1dcb0cec8 (diff)
Need an extra sa_release() when de-allocating exchange-associated SAs;
thus, failed exchanges/negotiations don't leak SAs and transports. ok niklas@
Diffstat (limited to 'sbin/isakmpd/exchange.c')
-rw-r--r--sbin/isakmpd/exchange.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/isakmpd/exchange.c b/sbin/isakmpd/exchange.c
index 8d5d041e7af..17560a034da 100644
--- a/sbin/isakmpd/exchange.c
+++ b/sbin/isakmpd/exchange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exchange.c,v 1.60 2001/08/15 13:06:53 ho Exp $ */
+/* $OpenBSD: exchange.c,v 1.61 2001/08/22 07:09:03 angelos Exp $ */
/* $EOM: exchange.c,v 1.143 2000/12/04 00:02:25 angelos Exp $ */
/*
@@ -1220,10 +1220,13 @@ exchange_free_aux (void *v_exch)
if (exchange->finalize)
exchange->finalize (exchange, exchange->finalize_arg, 1);
- /* Remove any SAs that has not been disassociated from us. */
+ /* Remove any SAs that have not been disassociated from us. */
for (sa = TAILQ_FIRST (&exchange->sa_list); sa; sa = next_sa)
{
next_sa = TAILQ_NEXT (sa, next);
+ /* One for the reference in exchange->sa_list. */
+ sa_release (sa);
+ /* And two more for the expiration and SA linked list. */
sa_free (sa);
}