diff options
Diffstat (limited to 'utils/hwstub/lib/hwstub_net.cpp')
-rw-r--r-- | utils/hwstub/lib/hwstub_net.cpp | 2 |
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 | |||
135 | int err = getaddrinfo(domain.c_str(), port.c_str(), &hints, &result); | 135 | int err = getaddrinfo(domain.c_str(), port.c_str(), &hints, &result); |
136 | if(err != 0) | 136 | if(err != 0) |
137 | { | 137 | { |
138 | freeaddrinfo(result); | ||
138 | if(error) | 139 | if(error) |
139 | *error = std::string("getaddrinfo failed: ") + gai_strerror(err); | 140 | *error = std::string("getaddrinfo failed: ") + gai_strerror(err); |
140 | return -1; | 141 | return -1; |
@@ -163,6 +164,7 @@ namespace | |||
163 | else | 164 | else |
164 | break; /* success */ | 165 | break; /* success */ |
165 | } | 166 | } |
167 | freeaddrinfo(result); | ||
166 | /* no address was tried */ | 168 | /* no address was tried */ |
167 | if(socket_fd < 0 && error) | 169 | if(socket_fd < 0 && error) |
168 | *error = "getaddrinfo() returned no usable result (socket()/connect()/bind() failed)"; | 170 | *error = "getaddrinfo() returned no usable result (socket()/connect()/bind() failed)"; |