summaryrefslogtreecommitdiffstats
path: root/src/pre_test.cpp
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-11-30 14:57:03 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-11-30 14:57:03 +0200
commit3beb07058c3781d9f3ce888be636b6484f750c96 (patch)
tree2ff894c46352ecb158981bf6fab90dfa26c952d2 /src/pre_test.cpp
parent2ded6e3d81538e2b0e016463ab8a56b08c075cbd (diff)
Fix memory leak in pretest
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
Diffstat (limited to 'src/pre_test.cpp')
-rw-r--r--src/pre_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pre_test.cpp b/src/pre_test.cpp
index df753be5..7127645d 100644
--- a/src/pre_test.cpp
+++ b/src/pre_test.cpp
@@ -35,6 +35,15 @@ CPretestOnePortInfo::CPretestOnePortInfo() {
m_stats.clear();
}
+CPretestOnePortInfo::~CPretestOnePortInfo() {
+ for (std::vector<COneIPInfo *>::iterator it = m_src_info.begin(); it != m_src_info.end(); ++it) {
+ delete *it;
+ }
+ for (std::vector<COneIPInfo *>::iterator it = m_dst_info.begin(); it != m_dst_info.end(); ++it) {
+ delete *it;
+ }
+}
+
void CPretestOnePortInfo::add_src(uint32_t ip, uint16_t vlan, MacAddress mac) {
COneIPv4Info *one_ip = new COneIPv4Info(ip, vlan, mac);
assert(one_ip);