Skip to content

Commit

Permalink
Coverity issues in contrail-controller/dns_mgr.cc
Browse files Browse the repository at this point in the history
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 <anicolae@lenovo.com>
  • Loading branch information
Anda Nicolae committed May 9, 2018
1 parent ca90a5d commit db8ce51
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dns/mgr/dns_mgr.cc
Expand Up @@ -1064,6 +1064,7 @@ void DnsManager::VdnsRecordsMsgHandler(const std::string &key,

} else {
SandeshError("Invalid Request Enter Vdns Server Name", context);
delete resp;
}
}

Expand Down Expand Up @@ -1179,6 +1180,7 @@ void DnsManager::BindPendingMsgHandler(const std::string &key,

} else {
SandeshError("Invalid Request No DnsManager Object ", context);
delete resp;
}
}

Expand Down

0 comments on commit db8ce51

Please sign in to comment.