summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/ChangeLog5
-rw-r--r--bgpd/bgpd.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index a8a6c350..90d0e0e3 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-27 Paul Jakma <paul.jakma@sun.com>
+
+ * bgpd.c: (peer_delete) Ensure freed buffers can not be
+ accidently reused. A potential fix for bug #287.
+
2006-07-02 Paul Jakma <paul.jakma@sun.com>
* bgp_fsm.c: (bgp_{stop,start}) Move clear/free of certain
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index b574a9aa..8ed598d2 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1205,18 +1205,19 @@ peer_delete (struct peer *peer)
/* Buffers. */
if (peer->ibuf)
stream_free (peer->ibuf);
-
if (peer->obuf)
stream_fifo_free (peer->obuf);
-
if (peer->work)
stream_free (peer->work);
-
+ peer->obuf = NULL;
+ peer->work = peer->ibuf = NULL;
+
/* Local and remote addresses. */
if (peer->su_local)
sockunion_free (peer->su_local);
if (peer->su_remote)
sockunion_free (peer->su_remote);
+ peer->su_local = peer->su_remote = NULL;
bgp_sync_delete (peer);