Do not forget to call freeaddrinfo, fix a memleak

For the getaddrinfo call we added in the previous commit, to convert the IP
provided in the conf.
This commit is contained in:
Florent Le Coz
2015-12-03 20:41:48 +01:00
parent 05a82b810f
commit 6a7cd5eecf
@@ -68,6 +68,7 @@ void TCPSocketHandler::init_socket(const struct addrinfo* rp)
<< gai_strerror(err)); << gai_strerror(err));
else else
{ {
utils::ScopeGuard sg([result](){ freeaddrinfo(result); });
struct addrinfo* rp; struct addrinfo* rp;
int bind_error; int bind_error;
for (rp = result; rp; rp = rp->ai_next) for (rp = result; rp; rp = rp->ai_next)