summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nhrpd/nhrp_cache.c2
-rw-r--r--nhrpd/nhrp_peer.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c
index 1a11e0d98b..e0b8f7bf88 100644
--- a/nhrpd/nhrp_cache.c
+++ b/nhrpd/nhrp_cache.c
@@ -70,6 +70,8 @@ static void nhrp_cache_free(struct nhrp_cache *c)
notifier_call(&c->notifier_list, NOTIFY_CACHE_DELETE);
assert(!notifier_active(&c->notifier_list));
hash_release(nifp->cache_hash, c);
+ if (c->cur.peer)
+ nhrp_peer_notify_del(c->cur.peer, &c->peer_notifier);
nhrp_peer_unref(c->cur.peer);
nhrp_peer_unref(c->new.peer);
EVENT_OFF(c->t_timeout);
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index ffb6cf7506..ef92d81436 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -45,7 +45,8 @@ static void nhrp_peer_check_delete(struct nhrp_peer *p)
EVENT_OFF(p->t_fallback);
EVENT_OFF(p->t_timer);
- hash_release(nifp->peer_hash, p);
+ if (nifp->peer_hash)
+ hash_release(nifp->peer_hash, p);
nhrp_interface_notify_del(p->ifp, &p->ifp_notifier);
nhrp_vc_notify_del(p->vc, &p->vc_notifier);
XFREE(MTYPE_NHRP_PEER, p);