From 774865b4b4e1e36719b0e4e6a0d46270593e0c64 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 10 Mar 2004 13:48:46 +0000 Subject: free peer list on exit, claudio ok --- usr.sbin/bgpd/bgpd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.sbin/bgpd') 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 @@ -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(); -- cgit v1.2.3