mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1183781 - Fix leak in nsHostResolver r=sworkman
This commit is contained in:
parent
d2ab629a20
commit
f86dd2a004
@ -471,6 +471,15 @@ HostDB_ClearEntry(PLDHashTable *table,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
MutexAutoLock lock(he->rec->addr_info_lock);
|
||||
if (he->rec->addr_info) {
|
||||
delete hr->addr_info;
|
||||
he->rec->addr_info = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
NS_RELEASE(he->rec);
|
||||
}
|
||||
|
||||
@ -853,8 +862,12 @@ nsHostResolver::ResolveHost(const char *host,
|
||||
LOG((" Trying AF_UNSPEC entry for host [%s%s%s] af: %s.\n",
|
||||
LOG_HOST(host, netInterface),
|
||||
(af == PR_AF_INET) ? "AF_INET" : "AF_INET6"));
|
||||
|
||||
he->rec->addr_info = nullptr;
|
||||
// Ensure existing `addr_info` in `he` is cleared before
|
||||
// copying from `unSpecHe`.
|
||||
if (he->rec->addr_info) {
|
||||
delete he->rec->addr_info;
|
||||
he->rec->addr_info = nullptr;
|
||||
}
|
||||
if (unspecHe->rec->negative) {
|
||||
he->rec->negative = unspecHe->rec->negative;
|
||||
he->rec->CopyExpirationTimesAndFlagsFrom(unspecHe->rec);
|
||||
|
Loading…
Reference in New Issue
Block a user