summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/zebra_rib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 7c140598c2..297a4ab95b 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2223,10 +2223,11 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
assert(!src_p || afi == AFI_IP6);
/* Lookup table. */
- table = zebra_vrf_table_with_table_id(afi, safi, re->vrf_id,
- re->table);
- if (!table)
+ table = zebra_vrf_table_with_table_id(afi, safi, re->vrf_id, re->table);
+ if (!table) {
+ XFREE(MTYPE_RE, re);
return 0;
+ }
/* Make it sure prefixlen is applied to the prefix. */
apply_mask(p);