diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-03-10 14:54:12 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-03-10 14:54:12 +0000 |
commit | 853ecc4e3fcf1f0cf0ee328c9746559bfa50ca20 (patch) | |
tree | ab41888a9da521c47855f703d740a3e921382e19 /usr.sbin | |
parent | a7c89a3d6c175ef43aecb238ce95c25527802845 (diff) |
while walking the peer list on shutdown free the peer structs
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/session.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index d2f51c7fd5c..9e9b64e4c0f 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.131 2004/03/10 14:45:25 henning Exp $ */ +/* $OpenBSD: session.c,v 1.132 2004/03/10 14:54:11 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -353,8 +353,11 @@ session_main(struct bgpd_config *config, struct peer *cpeers, nfds -= control_dispatch_msg(&pfd[j], j); } - for (p = peers; p != NULL; p = p->next) + while ((p = peers) != NULL) { + peers = p->next; bgp_fsm(p, EVNT_STOP); + free(p); + } msgbuf_write(&ibuf_rde.w); msgbuf_clear(&ibuf_rde.w); |