]> git.proxmox.com Git - mirror_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:47:54 +0000 (15:47 -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 4138369a000503a5055e26bb8772d8f8792e1063..70e55e6d7b0925fa08623b7428e89dcb11af43aa 100644 (file)
@@ -3040,6 +3040,8 @@ int 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))