From 13dfea50e4aba145d57ce32247208d7108d5e803 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Wed, 17 Apr 2019 19:15:43 -0400 Subject: [PATCH] zebra: Check for nexthop group before free on fail 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 --- zebra/zebra_rib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 96e5816da..6fe87697b 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; } -- 2.39.5