diff options
author | 2004-08-05 20:56:11 +0000 | |
---|---|---|
committer | 2004-08-05 20:56:11 +0000 | |
commit | 6b45d7daf7cfc98f2be39877d3015b7d89eb9677 (patch) | |
tree | 278962c58f947965f38e971e2411956918ede4c3 | |
parent | compile before you commit damnit (diff) | |
download | wireguard-openbsd-6b45d7daf7cfc98f2be39877d3015b7d89eb9677.tar.xz wireguard-openbsd-6b45d7daf7cfc98f2be39877d3015b7d89eb9677.zip |
As usual cleanup on exit. OK henning@
-rw-r--r-- | usr.sbin/bgpd/rde.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 16 |
3 files changed, 19 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 97e2d2bdc30..1743fb0de0f 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.135 2004/08/05 18:44:19 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.136 2004/08/05 20:56:11 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1599,7 +1599,9 @@ rde_shutdown(void) nexthop_shutdown(); path_shutdown(); + aspath_shutdown(); pt_shutdown(); peer_shutdown(); + free(mrt); } diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index e7829dba2dc..17007e6cc8d 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.49 2004/08/05 18:44:19 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.50 2004/08/05 20:56:12 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -256,6 +256,7 @@ int aspath_verify(void *, u_int16_t); #define AS_ERR_TYPE -2 #define AS_ERR_BAD -3 void aspath_init(u_int32_t); +void aspath_shutdown(void); struct aspath *aspath_get(void *, u_int16_t); void aspath_put(struct aspath *); u_char *aspath_dump(struct aspath *); diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 756d4649869..cbb7e925c35 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.40 2004/08/05 18:44:19 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.41 2004/08/05 20:56:12 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -720,7 +720,7 @@ aspath_init(u_int32_t hashsize) ; astable.hashtbl = calloc(hs, sizeof(struct aspath_list)); if (astable.hashtbl == NULL) - fatal("path_init"); + fatal("aspath_init"); for (i = 0; i < hs; i++) LIST_INIT(&astable.hashtbl[i]); @@ -728,6 +728,18 @@ aspath_init(u_int32_t hashsize) astable.hashmask = hs - 1; } +void +aspath_shutdown(void) +{ + u_int32_t i; + + for (i = 0; i <= astable.hashmask; i++) + if (!LIST_EMPTY(&astable.hashtbl[i])) + log_warnx("path_free: free non-free table"); + + free(astable.hashtbl); +} + struct aspath * aspath_get(void *data, u_int16_t len) { |