mirror of
https://github.com/Kiritow/GSock.git
synced 2024-03-22 13:10:51 +08:00
Fix memory leak in DNSResolve
This commit is contained in:
parent
5a32be1e79
commit
8290d01644
|
@ -469,11 +469,13 @@ int DNSResolve(const std::string& HostName, std::string& _out_IPStr)
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
sockaddr_in * addr = (struct sockaddr_in*) (ptr->ai_addr);
|
sockaddr_in * addr = (struct sockaddr_in*) (ptr->ai_addr);
|
||||||
_out_IPStr = inet_ntoa(addr->sin_addr);
|
_out_IPStr = inet_ntoa(addr->sin_addr);
|
||||||
|
freeaddrinfo(result);
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Unknown error.
|
/// Unknown error.
|
||||||
|
freeaddrinfo(result);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user