From cbe0ddc28cab60712890c756bc6129ada7c52215 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 17 Aug 2020 14:02:28 +0200 Subject: [PATCH] Free memory from getaddrinfo() We handled this in the failure scenario, but not in the vastly more common successful case. --- common/network/TcpSocket.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 07c8d2cd..48e4ebd0 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -459,6 +459,8 @@ void network::createTcpListeners(std::list *listeners, freeaddrinfo(ai); throw; } + + freeaddrinfo(ai); } void network::createTcpListeners(std::list *listeners, -- 2.39.5