diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-19 01:13:35 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-19 01:13:35 +0000 |
commit | 7f7182b97c1a62bb6ba9ded47fa72f576864ae6c (patch) | |
tree | b407d19d8be80211b7fefdfde249a7d2671f2ff9 /usr.sbin | |
parent | 05aee992167561aee015e9a9ba4c2984f76521e8 (diff) |
for(p = something; p != NULL; p = p->next) is not going to fly if there is
a free(p) inside that for loop...
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 377d7500ed5..1fda1e3161e 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.4 2003/12/18 22:22:22 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.5 2003/12/19 01:13:34 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -523,7 +523,7 @@ struct peer_table { void peer_init(struct bgpd_config *bgpconf, u_long hashsize) { - struct peer *p; + struct peer *p, *next; u_long hs, i; for (hs = 1; hs < hashsize; hs <<= 1) ; @@ -537,7 +537,8 @@ peer_init(struct bgpd_config *bgpconf, u_long hashsize) peertable.peer_hashmask = hs - 1; - for (p = bgpconf->peers; p != NULL; p = p->next) { + for (p = bgpconf->peers; p != NULL; p = next) { + next = p->next; p->conf.reconf_action = RECONF_NONE; peer_add(p->conf.id, &p->conf); free(p); |