]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: sanity check refcount correctness 2814/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 14 Aug 2018 20:08:50 +0000 (20:08 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 14 Aug 2018 20:08:50 +0000 (20:08 +0000)
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 <qlyoung@cumulusnetworks.com>
ospf6d/ospf6_flood.c

index ae26668c8ae8c199230459dd29818fcb20234726..c504be09fd5bf1afed1e6269a560d2a8b0993526 100644 (file)
@@ -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;
                                        }