]> git.puffer.fish Git - matthieu/frr.git/commitdiff
nhrpd: drop peer references on freeing cache entry
authorDavid Lamparter <equinox@opensourcerouting.org>
Sun, 19 Mar 2023 11:38:49 +0000 (12:38 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sun, 19 Mar 2023 11:38:49 +0000 (12:38 +0100)
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>
nhrpd/nhrp_cache.c

index 31b370cbf83927921c5a918b271aa5cd1b988c7d..42c6c2fbba765e629618ece4b3fb3d63e157294e 100644 (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);
+       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);