summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-29 23:02:25 +0200
committerGitHub <noreply@github.com>2021-06-29 23:02:25 +0200
commitd38079d053c39194ea6073a6c466d76421bb45b5 (patch)
treede3ab020e7c40bfc6256f143eaf63d1c0ecf4e97 /src
parentb6fb0203886debf786662b0bbc47c41e0578e905 (diff)
downloadopenttd-d38079d053c39194ea6073a6c466d76421bb45b5.tar.xz
Fix f7e390bd: freeaddrinfo() is not guaranteed to handle a nullptr graceful (#9404)
Diffstat (limited to 'src')
-rw-r--r--src/network/core/tcp_connect.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp
index c4f5415b0..dc7a23bb3 100644
--- a/src/network/core/tcp_connect.cpp
+++ b/src/network/core/tcp_connect.cpp
@@ -45,7 +45,7 @@ TCPConnecter::~TCPConnecter()
this->sockets.clear();
this->sock_to_address.clear();
- freeaddrinfo(this->ai);
+ if (this->ai != nullptr) freeaddrinfo(this->ai);
}
/**