From c957f7d9798d69fcb49ce6651914c481534b88aa Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Tue, 14 Aug 2018 20:08:50 +0000 Subject: [PATCH] ospf6d: sanity check refcount correctness Coverity warns about a possible double free; add an assert to make sure we never hit it, and hopefully silence Coverity. Signed-off-by: Quentin Young --- ospf6d/ospf6_flood.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index ae26668c8ae8..c504be09fd5b 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -330,6 +330,8 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa, zlog_debug( "Requesting the same, remove it, next neighbor"); if (req == on->last_ls_req) { + /* sanity check refcount */ + assert(req->lock >= 2); ospf6_lsa_unlock(req); on->last_ls_req = NULL; }