summaryrefslogtreecommitdiff
path: root/sys/net/if_spppsubr.c
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2009-02-18 08:36:21 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2009-02-18 08:36:21 +0000
commit87c16502dd04af5faa9289e9cbd072a865d42167 (patch)
tree17e1e17671d8aadc7e5dea9f172a580409fed251 /sys/net/if_spppsubr.c
parente09f3b77fffe98dfb94509816df2272aaceb6b8b (diff)
Free authentication data when detaching sppp from interface.
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r--sys/net/if_spppsubr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 847805f15a0..44784cd09d5 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.74 2009/02/16 23:24:01 deraadt Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.75 2009/02/18 08:36:20 canacar Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -963,6 +963,16 @@ sppp_detach(struct ifnet *ifp)
for (i = 0; i < IDX_COUNT; i++)
UNTIMEOUT((cps[i])->TO, (void *)sp, sp->ch[i]);
UNTIMEOUT(sppp_pap_my_TO, (void *)sp, sp->pap_my_to_ch);
+
+ /* release authentication data */
+ if (sp->myauth.name != NULL)
+ free(sp->myauth.name, M_DEVBUF);
+ if (sp->myauth.secret != NULL)
+ free(sp->myauth.secret, M_DEVBUF);
+ if (sp->hisauth.name != NULL)
+ free(sp->hisauth.name, M_DEVBUF);
+ if (sp->hisauth.secret != NULL)
+ free(sp->hisauth.secret, M_DEVBUF);
}
/*