bgpd: bgp_default may be null

The bgp_default variable when saved to the side might actually
be NULL.

Ticket: CM-21119
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-05-23 14:54:30 -04:00
parent 0e42e319d5
commit 1f4b2cce95

View File

@ -188,7 +188,8 @@ static __attribute__((__noreturn__)) void bgp_exit(int status)
continue;
bgp_delete(bgp);
}
bgp_delete(bgp_default);
if (bgp_default)
bgp_delete(bgp_default);
/* reverse bgp_dump_init */
bgp_dump_finish();