diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-18 02:16:30 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-18 02:16:30 +0200 |
commit | 308000eefaec7ce78e9a28ff6efa2969b4a3686b (patch) | |
tree | be147410c99edf6c89a2cac8ffd6d88d12474571 /bgpd/bgp_mac.c | |
parent | Merge pull request #4514 from opensourcerouting/warnings-20190612 (diff) | |
download | frr-308000eefaec7ce78e9a28ff6efa2969b4a3686b.tar.xz frr-308000eefaec7ce78e9a28ff6efa2969b4a3686b.zip |
bgpd: Fix memleak of Mac Hash String upon insertion
If we get a callback for a interface change but we do not
actually have to move the mac entry in the hash then
we were accidently leaking the Mac Hash String all over
ourselves. Messy Messy!
Ticket: CM-25351
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_mac.c')
-rw-r--r-- | bgpd/bgp_mac.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_mac.c b/bgpd/bgp_mac.c index f19453fec..bd3a6031a 100644 --- a/bgpd/bgp_mac.c +++ b/bgpd/bgp_mac.c @@ -282,8 +282,10 @@ void bgp_mac_add_mac_entry(struct interface *ifp) * If old mac address is the same as the new, * then there is nothing to do here */ - if (old_bsm == bsm) + if (old_bsm == bsm) { + XFREE(MTYPE_BSM_STRING, ifname); return; + } if (old_bsm) bgp_mac_remove_ifp_internal(old_bsm, ifp->name); |