Fix another memory leak.

This commit is contained in:
Donal Cahill
2015-12-13 08:10:40 +00:00
parent 8748abb525
commit a5540557ac

View File

@@ -887,12 +887,16 @@ bool CUser::IsHostAllowed(const CString& sHostMask) const {
iIsRangeValid = getaddrinfo(vsSplitCIDR.front().c_str(), NULL,
&aiHints, &aiRange);
if (iIsRangeValid != 0) {
freeaddrinfo(aiHost);
continue;
}
freeaddrinfo(aiHost);
continue;
}
// "/0" allows all IPv[4|6] addresses
if (iRoutingPrefix == 0) return true;
if (iRoutingPrefix == 0) {
freeaddrinfo(aiHost);
freeaddrinfo(aiRange);
return true;
}
// If both IPs are valid and of the same type, make a bit field mask
// from the routing prefix, AND it to the host and range, and see if