summaryrefslogtreecommitdiff
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-07-27 19:05:12 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-07-27 19:05:12 +0000
commit1893740016d35d75de567a5f6b74db2314ffdc52 (patch)
tree95175d82fa7affe687afe8f9db893aee5746686c /bgpd/bgpd.c
parentf366ad31ae6bf7e2fb7271cf8eab6dee4af3baf9 (diff)
[bgpd] Potential bug#287 fix, peer_delete should NULL out freed buffers
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.
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c7
1 files changed, 4 insertions, 3 deletions
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);