Skip to content

Commit

Permalink
quic: fix up coverity warning in quic/session.cc
Browse files Browse the repository at this point in the history
- add CHECK around SocketAddress::New like we have in other
  places as suggested by Coverity scan

Signed-off-by: Michael Dawson <midawson@redhat.com>

PR-URL: #49865
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
mhdawson committed Oct 12, 2023
1 parent c1a3a98 commit 971af4b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/quic/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,10 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) {
auto ipv4 = preferredAddress->ipv4();
if (ipv4.has_value()) {
if (ipv4->address.empty() || ipv4->port == 0) return;
SocketAddress::New(AF_INET,
std::string(ipv4->address).c_str(),
ipv4->port,
&remote_address_);
CHECK(SocketAddress::New(AF_INET,
std::string(ipv4->address).c_str(),
ipv4->port,
&remote_address_));
preferredAddress->Use(ipv4.value());
}
break;
Expand All @@ -1315,10 +1315,10 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) {
auto ipv6 = preferredAddress->ipv6();
if (ipv6.has_value()) {
if (ipv6->address.empty() || ipv6->port == 0) return;
SocketAddress::New(AF_INET,
std::string(ipv6->address).c_str(),
ipv6->port,
&remote_address_);
CHECK(SocketAddress::New(AF_INET,
std::string(ipv6->address).c_str(),
ipv6->port,
&remote_address_));
preferredAddress->Use(ipv6.value());
}
break;
Expand Down

0 comments on commit 971af4b

Please sign in to comment.