From: Renato Westphal Date: Tue, 22 Aug 2017 23:09:26 +0000 (-0300) Subject: bgpd: fix file descriptor leak X-Git-Tag: frr-4.0-dev~381^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5ecf5540097c30ab0b02b3ac18133b17e660c9db;p=matthieu%2Ffrr.git bgpd: fix file descriptor leak Bug introduced by commit 37d361e7. Removing the call to bgp_close() from bgp_delete() was a mistake. Reported-by: Don Slice Signed-off-by: Renato Westphal --- diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 9d7c38c871..e3650417fa 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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))