mirror of
https://github.com/godotengine/godot.git
synced 2025-10-23 18:03:35 +00:00
Various coverity scan fixes for networking
Fix FreeBSD websocket compilation error
This commit is contained in:
parent
7d6f210ccb
commit
03bf783f3c
6 changed files with 42 additions and 14 deletions
|
|
@ -101,7 +101,7 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) {
|
|||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
};
|
||||
hints.ai_flags &= !AI_NUMERICHOST;
|
||||
hints.ai_flags &= ~AI_NUMERICHOST;
|
||||
|
||||
int s = getaddrinfo(p_hostname.utf8().get_data(), NULL, &hints, &result);
|
||||
if (s != 0) {
|
||||
|
|
@ -111,6 +111,8 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) {
|
|||
|
||||
if (result == NULL || result->ai_addr == NULL) {
|
||||
ERR_PRINT("Invalid response from getaddrinfo");
|
||||
if (result)
|
||||
freeaddrinfo(result);
|
||||
return IP_Address();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue