From 7d2109b97d846fc3050fc9bab431dc059618bd06 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Wed, 13 May 2020 19:08:05 +0000 Subject: [PATCH] wimax: fix memory leak due to struct alignment --- src/wimax/model/wimax-tlv.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wimax/model/wimax-tlv.cc b/src/wimax/model/wimax-tlv.cc index c5b29983e..abd23860d 100644 --- a/src/wimax/model/wimax-tlv.cc +++ b/src/wimax/model/wimax-tlv.cc @@ -890,7 +890,7 @@ PortRangeTlvValue::~PortRangeTlvValue () uint32_t PortRangeTlvValue::GetSerializedSize (void) const { - return m_portRange->size () * sizeof(struct PortRange); + return m_portRange->size () * 4; // a port range is defined by 2 ports, each using 2 bytes } void PortRangeTlvValue::Serialize (Buffer::Iterator i) const @@ -1037,7 +1037,7 @@ Ipv4AddressTlvValue::~Ipv4AddressTlvValue () uint32_t Ipv4AddressTlvValue::GetSerializedSize (void) const { - return m_ipv4Addr->size () * sizeof(struct ipv4Addr); + return m_ipv4Addr->size () * 8; // IPv4 address and mask are 4 bytes each } void