We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87dd04f commit 02e8340Copy full SHA for 02e8340
src/viewer/svutil.cpp
@@ -297,8 +297,13 @@ SVNetwork::SVNetwork(const char *hostname, int port) {
297
# endif // _WIN32
298
}
299
300
- stream_ = socket(addr_info->ai_family, addr_info->ai_socktype,
301
- addr_info->ai_protocol);
+ if (addr_info == nullptr) {
+ // Mark stream_ as invalid.
302
+ stream_ = -1;
303
+ } else {
304
+ stream_ = socket(addr_info->ai_family, addr_info->ai_socktype,
305
+ addr_info->ai_protocol);
306
+ }
307
308
if (stream_ < 0) {
309
std::cerr << "Failed to open socket" << std::endl;
0 commit comments