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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user