summaryrefslogtreecommitdiffstats
path: root/nhrpd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-03-19 12:38:49 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-03-19 12:38:49 +0100
commit637a914d19138c1c7b6aa7b6925b8a396a6a1ce1 (patch)
treecfa17996e715c1cb4711f21b154c52125a9caca3 /nhrpd
parentMerge pull request #13025 from donaldsharp/ospf_ti_lfa_leaks (diff)
downloadfrr-637a914d19138c1c7b6aa7b6925b8a396a6a1ce1.tar.xz
frr-637a914d19138c1c7b6aa7b6925b8a396a6a1ce1.zip
nhrpd: drop peer references on freeing cache entry
When dropping an interface (e.g. at shutdown) while there are still valid cache entries, the reference held on the cache entries' peer pointers was leaking. Fixes: #12505 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/nhrp_cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c
index 31b370cbf..42c6c2fbb 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);
+ nhrp_peer_unref(c->cur.peer);
+ nhrp_peer_unref(c->new.peer);
THREAD_OFF(c->t_timeout);
THREAD_OFF(c->t_auth);
XFREE(MTYPE_NHRP_CACHE, c);