mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 05:31:39 +00:00
dnsapi: Free the buffer in the early return paths.
This commit is contained in:
parent
55b3e6095b
commit
5b0430a178
|
@ -192,11 +192,16 @@ static NTSTATUS resolv_get_serverlist( void *args )
|
|||
if (filter( buf[i].sin.sin_family, params->family )) continue;
|
||||
found++;
|
||||
}
|
||||
if (!found) return DNS_ERROR_NO_DNS_SERVERS;
|
||||
if (!found)
|
||||
{
|
||||
free( buf );
|
||||
return DNS_ERROR_NO_DNS_SERVERS;
|
||||
}
|
||||
|
||||
needed = FIELD_OFFSET(DNS_ADDR_ARRAY, AddrArray[found]);
|
||||
if (!addrs || *params->len < needed)
|
||||
{
|
||||
free( buf );
|
||||
*params->len = needed;
|
||||
return !addrs ? ERROR_SUCCESS : ERROR_MORE_DATA;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue