dnsapi: Fix some potential infinite loops because of an unsigned loop counter.

This commit is contained in:
Alexandre Julliard 2007-07-12 17:32:07 +02:00
parent 4688389d74
commit 98934f20d8
2 changed files with 2 additions and 4 deletions

View File

@ -418,8 +418,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W
r->Data.TXT.pStringArray[i] = dns_str_from_rdata( pos );
if (!r->Data.TXT.pStringArray[i])
{
for (--i; i >= 0; i--)
dns_free( r->Data.TXT.pStringArray[i] );
while (i > 0) dns_free( r->Data.TXT.pStringArray[--i] );
return ERROR_NOT_ENOUGH_MEMORY;
}
i++;

View File

@ -443,8 +443,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
if (!dst->Data.TXT.pStringArray[i])
{
for (--i; i >= 0; i--)
dns_free( dst->Data.TXT.pStringArray[i] );
while (i > 0) dns_free( dst->Data.TXT.pStringArray[--i] );
goto error;
}
}