Merge pull request #102 from paullouisageneau/fix-getaddrinfo-leak

Fix getaddrinfo() leak in Candidate::resolve()
This commit is contained in:
Paul-Louis Ageneau
2020-06-25 09:26:18 +02:00
committed by GitHub

View File

@ -107,8 +107,9 @@ bool Candidate::resolve(ResolveMode mode) {
oss << sp << nodebuffer << sp << servbuffer << sp << "typ" << sp << type; oss << sp << nodebuffer << sp << servbuffer << sp << "typ" << sp << type;
oss << left; oss << left;
mCandidate = oss.str(); mCandidate = oss.str();
mIsResolved = true;
PLOG_VERBOSE << "Resolved candidate: " << mCandidate; PLOG_VERBOSE << "Resolved candidate: " << mCandidate;
return mIsResolved = true; break;
} }
} }
} }
@ -116,7 +117,7 @@ bool Candidate::resolve(ResolveMode mode) {
freeaddrinfo(result); freeaddrinfo(result);
} }
return false; return mIsResolved;
} }
bool Candidate::isResolved() const { return mIsResolved; } bool Candidate::isResolved() const { return mIsResolved; }