]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix file descriptor leak 1030/head
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 22 Aug 2017 23:09:26 +0000 (20:09 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 22 Aug 2017 23:09:26 +0000 (20:09 -0300)
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 9d7c38c8716d498b65b1645a90189a1d626698f9..e3650417fa662514c6ea0e13d32fd650d1fe515c 100644 (file)
@@ -3087,6 +3087,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))