]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: plug memory leak in rib_add_multipath()
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 5 Sep 2017 11:21:31 +0000 (08:21 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 21 Sep 2017 16:27:50 +0000 (13:27 -0300)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/zebra_rib.c

index 7c140598c2adc09c0b1d469970386fc0ec7ffe79..297a4ab95bbeda66a6a647fb657dac9904831df5 100644 (file)
@@ -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);