Merge pull request #1030 from opensourcerouting/bgpd-fd-leak

bgpd: fix file descriptor leak
This commit is contained in:
Quentin Young 2017-08-23 15:45:53 -04:00 committed by GitHub
commit e1b9b080b8

View 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))