]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: tests - add null pointer protection to fix bgp test failures
authorLou Berger <lberger@labn.net>
Tue, 12 Jan 2016 18:41:58 +0000 (13:41 -0500)
committervivek <vivek@cumulusnetworks.com>
Thu, 9 Jun 2016 04:49:47 +0000 (21:49 -0700)
Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit d5d5e3e04fc41b9a89b7ce9049fd322bdbde2e4d)

Conflicts:
bgpd/bgp_nexthop.c

bgpd/bgp_nexthop.c
tests/bgp_mpath_test.c

index d81c6a80521c82409613b8228bc0a9b97c826b5b..80495065b0db45aba5910daa9c19f37cd2dac96a 100644 (file)
@@ -148,6 +148,8 @@ bgp_address_init (struct bgp *bgp)
 void
 bgp_address_destroy (struct bgp *bgp)
 {
+  if (bgp->address_hash == NULL)
+    return;
   hash_clean(bgp->address_hash, NULL);
   hash_free(bgp->address_hash);
   bgp->address_hash = NULL;
index af62308b88f6b0a7945587ecc85c4d36441d225d..bafbef75fbcac2b048c5e9588b6aa5dd881c6921 100644 (file)
@@ -387,7 +387,8 @@ global_test_init (void)
 static int
 global_test_cleanup (void)
 {
-  zclient_free (zclient);
+  if (zclient != NULL)
+    zclient_free (zclient);
   thread_master_free (master);
   return 0;
 }