summaryrefslogtreecommitdiff
path: root/louloulibs/network
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-12-03 20:41:48 +0100
committerFlorent Le Coz <louiz@louiz.org>2015-12-03 20:41:48 +0100
commit6a7cd5eecfa4df0552969e5d5d57452d290b7fc5 (patch)
tree895d8c0ef10e293abfeb35d93f3b70ca054f98de /louloulibs/network
parent05a82b810f09d5cf3a0388fc4eeb523d33662c9c (diff)
downloadbiboumi-6a7cd5eecfa4df0552969e5d5d57452d290b7fc5.tar.gz
biboumi-6a7cd5eecfa4df0552969e5d5d57452d290b7fc5.tar.bz2
biboumi-6a7cd5eecfa4df0552969e5d5d57452d290b7fc5.tar.xz
biboumi-6a7cd5eecfa4df0552969e5d5d57452d290b7fc5.zip
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.
Diffstat (limited to 'louloulibs/network')
-rw-r--r--louloulibs/network/tcp_socket_handler.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/louloulibs/network/tcp_socket_handler.cpp b/louloulibs/network/tcp_socket_handler.cpp
index 83863b0..6ed981c 100644
--- a/louloulibs/network/tcp_socket_handler.cpp
+++ b/louloulibs/network/tcp_socket_handler.cpp
@@ -68,6 +68,7 @@ void TCPSocketHandler::init_socket(const struct addrinfo* rp)
<< gai_strerror(err));
else
{
+ utils::ScopeGuard sg([result](){ freeaddrinfo(result); });
struct addrinfo* rp;
int bind_error;
for (rp = result; rp; rp = rp->ai_next)