summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-03-10 13:48:46 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-03-10 13:48:46 +0000
commit774865b4b4e1e36719b0e4e6a0d46270593e0c64 (patch)
tree3deac882d2443c2cf47efc6d80d325bc1a0cdc2e
parentac5478b335d6a94bbe9098bfbacd19591ca140b8 (diff)
free peer list on exit, claudio ok
-rw-r--r--usr.sbin/bgpd/bgpd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 15053e91fdd..9aeb5db5f35 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.81 2004/03/01 16:53:48 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.82 2004/03/10 13:48:45 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -93,7 +93,7 @@ int
main(int argc, char *argv[])
{
struct bgpd_config conf;
- struct peer *peer_l;
+ struct peer *peer_l, *p;
struct mrt_head mrt_l;
struct network_head net_l;
struct filter_head *rules_l;
@@ -321,6 +321,11 @@ main(int argc, char *argv[])
pid = waitpid(-1, NULL, WNOHANG);
} while (pid > 0 || (pid == -1 && errno == EINTR));
+ while ((p = peer_l) != NULL) {
+ peer_l = p->next;
+ free(p);
+ }
+
free(rules_l);
control_cleanup();
kr_shutdown();