diff options
author | Patric Stout <truebrain@openttd.org> | 2021-06-29 23:02:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 23:02:25 +0200 |
commit | d38079d053c39194ea6073a6c466d76421bb45b5 (patch) | |
tree | de3ab020e7c40bfc6256f143eaf63d1c0ecf4e97 /src/network | |
parent | b6fb0203886debf786662b0bbc47c41e0578e905 (diff) | |
download | openttd-d38079d053c39194ea6073a6c466d76421bb45b5.tar.xz |
Fix f7e390bd: freeaddrinfo() is not guaranteed to handle a nullptr graceful (#9404)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/core/tcp_connect.cpp | 2 |
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); } /** |