* bgpd.c: Deleting bgp->rsclient list needs fix similar to pree-groups
	  deleting fix. Avoid leaking bgp->group, bgp->peer and bgp->rsclient
	  lists.

	[backport candidate]
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 74fe596..7c33922 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,4 +1,10 @@
-2005-05-26 Hasso Tepper <hass at quagga.net>
+2005-05-27 Hasso Tepper <hasso at quagga.net>
+
+	* bgpd.c: Deleting bgp->rsclient list needs fix similar to pree-groups
+	  deleting fix. Avoid leaking bgp->group, bgp->peer and bgp->rsclient
+	  lists.
+
+2005-05-26 Hasso Tepper <hasso at quagga.net>
 
         * bgpd.c: Don't crash while deleting list of peer-groups.
 
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index f969661..e303395 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1930,11 +1930,14 @@
 
   for (ALL_LIST_ELEMENTS (bgp->group, node, next, group))
     peer_group_delete (group);
+  list_delete (bgp->group);
 
   for (ALL_LIST_ELEMENTS (bgp->peer, node, next, peer))
     peer_delete (peer);
+  list_delete (bgp->peer);
 
-  bgp->rsclient->del = (void (*)(void *)) peer_delete;
+  for (ALL_LIST_ELEMENTS (bgp->rsclient, node, next, peer))
+    peer_delete (peer);
   list_delete (bgp->rsclient);
 
   listnode_delete (bm->bgp, bgp);