summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-09-05 13:21:31 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-09-21 18:27:50 +0200
commit7865c65d23d296364c9430645202fbeeb5fb8390 (patch)
treee2deb7119ba5dd6de8e99cce9bc882a704677ea7 /zebra
parentzebra: use the afi parameter in rib_add_multipath() (diff)
downloadfrr-7865c65d23d296364c9430645202fbeeb5fb8390.tar.xz
frr-7865c65d23d296364c9430645202fbeeb5fb8390.zip
zebra: plug memory leak in rib_add_multipath()
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra')
-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 7c140598c..297a4ab95 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);