Skip to content

Commit

Permalink
Merge pull request #16166 from opensourcerouting/fix/backport_627fb27…
Browse files Browse the repository at this point in the history
…1f0a5103141f2eccda53dd2fa08ed0819_9.1

nhrpd: Fix nhrp_peer leak
  • Loading branch information
donaldsharp authored Jun 5, 2024
2 parents fe7ca5c + 1975d52 commit 1e56a82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions nhrpd/nhrp_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion nhrpd/nhrp_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e56a82

Please sign in to comment.