From db8ce51be96d7842e34bdb49594dc06280bc721d Mon Sep 17 00:00:00 2001 From: Anda Nicolae Date: Wed, 9 May 2018 15:16:12 +0300 Subject: [PATCH] Coverity issues in contrail-controller/dns_mgr.cc I have run Coverity on branch R5.0 and it reported the following issues in contrail-controller/dns_mgr.cc: - Variable resp going out of scope leaks the storage it points to in dns_mgr.cc:DnsManager::BindPendingMsgHandler - Variable resp going out of scope leaks the storage it points to in dns_mgr.cc:DnsManager::VdnsRecordsMsgHandler Indeed, in both functions (BindPendingMsgHandler and VdnsRecordsMsgHandler), variable resp is not freed on else branch. Change-Id: I52a4212777a352e0a7efbf02907db7987b8bc06a Closes-Bug: #1770152 Signed-off-by: Anda Nicolae --- src/dns/mgr/dns_mgr.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dns/mgr/dns_mgr.cc b/src/dns/mgr/dns_mgr.cc index 5defe9ea643..9642e991e3a 100644 --- a/src/dns/mgr/dns_mgr.cc +++ b/src/dns/mgr/dns_mgr.cc @@ -1064,6 +1064,7 @@ void DnsManager::VdnsRecordsMsgHandler(const std::string &key, } else { SandeshError("Invalid Request Enter Vdns Server Name", context); + delete resp; } } @@ -1179,6 +1180,7 @@ void DnsManager::BindPendingMsgHandler(const std::string &key, } else { SandeshError("Invalid Request No DnsManager Object ", context); + delete resp; } }