Merge pull request #14579 from Keelan10/fix-nhrpd-leak

nhrpd: Fix nhrp_peer leak
This commit is contained in:
Donald Sharp 2023-10-12 10:59:44 -04:00 committed by GitHub
commit ed262d0fb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -88,8 +88,8 @@ static void nhrp_request_stop(void)
nhrp_zebra_terminate();
vici_terminate();
evmgr_terminate();
nhrp_vc_terminate();
vrf_terminate();
nhrp_vc_terminate();
debugf(NHRP_DEBUG_COMMON, "Done.");
frr_fini();

View File

@ -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);