From 03bf783f3ce9d2a865bc509035dd883ffe0baa0c Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 19 Apr 2018 23:20:26 +0200 Subject: Various coverity scan fixes for networking Fix FreeBSD websocket compilation error --- drivers/unix/ip_unix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/unix/ip_unix.cpp') diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index a7fb0c388..949609bb9 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -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(); }; -- cgit v1.2.3-70-g09d2