Skip to content

Commit 152ec9d

Browse files
committed
Free addrinfo
1 parent c8bf61a commit 152ec9d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/streamconnection/AddressHelpers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ bool AddressHelpers::getHostByName(const std::string& hostname, struct in_addr&
161161
{
162162
struct sockaddr_in* ipv4 = reinterpret_cast<struct sockaddr_in*>(result->ai_addr);
163163
ipAddress.s_addr = ipv4->sin_addr.s_addr;
164+
freeaddrinfo(result);
165+
result = nullptr;
164166
return true;
165167
}
166168
return false;

0 commit comments

Comments
 (0)