]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix file descriptor leak
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 22 Aug 2017 23:09:26 +0000 (20:09 -0300)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 23 Aug 2017 19:49:41 +0000 (15:49 -0400)
Bug introduced by commit 37d361e7. Removing the call to bgp_close()
from bgp_delete() was a mistake.

Reported-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/bgpd.c

index c1635bdb418dda66be599693bc1445c976532775..22ea7d82c8e16bffc63f5faef2505272a414f0f6 100644 (file)
@@ -3201,6 +3201,8 @@ bgp_delete (struct bgp *bgp)
    * routes to be processed still referencing the struct bgp.
    */
   listnode_delete (bm->bgp, bgp);
+  if (list_isempty(bm->bgp))
+    bgp_close();
 
   /* Deregister from Zebra, if needed */
   if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))