]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ldpd: silence coverity scan warning
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 26 Jul 2017 01:36:00 +0000 (22:36 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 31 Jul 2017 11:56:44 +0000 (08:56 -0300)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/lde.c

index 602dc8805e54096a2547afce1847170884566252..77643ff48bbad3ca037925dcd020cfe35faa7309 100644 (file)
@@ -1328,7 +1328,6 @@ lde_nbr_addr_update(struct lde_nbr *ln, struct lde_addr *lde_addr, int removed)
        struct lde_map          *me;
 
        RB_FOREACH(fec, fec_tree, &ln->recv_map) {
-               fn = (struct fec_node *)fec_find(&ft, fec);
                switch (fec->type) {
                case FEC_TYPE_IPV4:
                        if (lde_addr->af != AF_INET)
@@ -1342,6 +1341,11 @@ lde_nbr_addr_update(struct lde_nbr *ln, struct lde_addr *lde_addr, int removed)
                        continue;
                }
 
+               fn = (struct fec_node *)fec_find(&ft, fec);
+               if (fn == NULL)
+                       /* shouldn't happen */
+                       continue;
+
                LIST_FOREACH(fnh, &fn->nexthops, entry) {
                        if (ldp_addrcmp(fnh->af, &fnh->nexthop,
                            &lde_addr->addr))