summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/hwstub/lib/hwstub_net.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/hwstub/lib/hwstub_net.cpp b/utils/hwstub/lib/hwstub_net.cpp
index c9d201a761..1d2fb2402b 100644
--- a/utils/hwstub/lib/hwstub_net.cpp
+++ b/utils/hwstub/lib/hwstub_net.cpp
@@ -135,6 +135,7 @@ namespace
int err = getaddrinfo(domain.c_str(), port.c_str(), &hints, &result);
if(err != 0)
{
+ freeaddrinfo(result);
if(error)
*error = std::string("getaddrinfo failed: ") + gai_strerror(err);
return -1;
@@ -163,6 +164,7 @@ namespace
else
break; /* success */
}
+ freeaddrinfo(result);
/* no address was tried */
if(socket_fd < 0 && error)
*error = "getaddrinfo() returned no usable result (socket()/connect()/bind() failed)";