From: Renato Westphal Date: Tue, 5 Sep 2017 11:21:31 +0000 (-0300) Subject: zebra: plug memory leak in rib_add_multipath() X-Git-Tag: frr-4.0-dev~277^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7865c65d23d296364c9430645202fbeeb5fb8390;p=matthieu%2Ffrr.git zebra: plug memory leak in rib_add_multipath() Signed-off-by: Renato Westphal --- 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);