]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Check for nexthop group before free on fail
authorStephen Worley <sworley@cumulusnetworks.com>
Wed, 17 Apr 2019 23:15:43 +0000 (19:15 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:39 +0000 (11:13 -0400)
Check to make sure the route entry has a nexthop
group before we try to free after a table lookup
failure.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_rib.c

index 96e5816da316810e91e365be6648021ea15bcb01..6fe87697b2a961f87f3cd988d7164765ab45db9b 100644 (file)
@@ -2653,7 +2653,8 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
        /* Lookup table.  */
        table = zebra_vrf_table_with_table_id(afi, safi, re->vrf_id, re->table);
        if (!table) {
-               nexthop_group_free_delete(&re->ng);
+               if (re->ng)
+                       nexthop_group_free_delete(&re->ng);
                XFREE(MTYPE_RE, re);
                return 0;
        }