bgpd: tests - add null pointer protection to fix bgp test failures
Signed-off-by: Lou Berger <lberger@labn.net>
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index d1c5c86..bb07eac 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -594,6 +594,9 @@
void
bgp_address_destroy (void)
{
+ if (bgp_address_hash == NULL)
+ return;
+
hash_clean(bgp_address_hash, NULL);
hash_free(bgp_address_hash);
bgp_address_hash = NULL;
diff --git a/tests/bgp_mpath_test.c b/tests/bgp_mpath_test.c
index a953ce9..174d299 100644
--- a/tests/bgp_mpath_test.c
+++ b/tests/bgp_mpath_test.c
@@ -395,7 +395,8 @@
static int
global_test_cleanup (void)
{
- zclient_free (zclient);
+ if (zclient != NULL)
+ zclient_free (zclient);
thread_master_free (master);
return 0;
}