diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c index 81d9bb255f7a..5f3e457e3136 100644 --- a/nhrpd/nhrp_cache.c +++ b/nhrpd/nhrp_cache.c @@ -74,6 +74,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); THREAD_OFF(c->t_timeout); THREAD_OFF(c->t_auth); XFREE(MTYPE_NHRP_CACHE, c); diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c index e7f2eaf5a7e1..e5e75dfea46c 100644 --- a/nhrpd/nhrp_peer.c +++ b/nhrpd/nhrp_peer.c @@ -49,7 +49,8 @@ static void nhrp_peer_check_delete(struct nhrp_peer *p) THREAD_OFF(p->t_fallback); THREAD_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);