bgpd: Ensure that bgp_delete bgp pointer is non-null

Crash w/ an assert if someone calls bgp_delete with a
NULL parameter as opposed to crashing when we dereference
the pointer a bit later.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-06-12 15:10:01 -04:00
parent 1f4b2cce95
commit bf383464ea

View File

@ -3300,6 +3300,7 @@ int bgp_delete(struct bgp *bgp)
afi_t afi; afi_t afi;
int i; int i;
assert(bgp);
THREAD_OFF(bgp->t_startup); THREAD_OFF(bgp->t_startup);
if (BGP_DEBUG(zebra, ZEBRA)) { if (BGP_DEBUG(zebra, ZEBRA)) {