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

This commit is contained in:
Alexandre Julliard 2007-07-12 17:32:24 +02:00
parent 98934f20d8
commit 4397e99585
2 changed files with 2 additions and 5 deletions

View file

@ -109,8 +109,7 @@ static char **split_hostnames( const char *hostnames )
return res;
oom:
for (--i; i >= 0; i--)
strfreeU( res[i] );
while (i > 0) strfreeU( res[--i] );
HeapFree( GetProcessHeap(), 0, res );
HeapFree( GetProcessHeap(), 0, str );

View file

@ -190,9 +190,7 @@ static char **bv2str_array( struct berval **bv )
str[i] = bv2str( *p );
if (!str[i])
{
for (--i; i >= 0; i--)
HeapFree( GetProcessHeap(), 0, str[i] );
while (i > 0) HeapFree( GetProcessHeap(), 0, str[--i] );
HeapFree( GetProcessHeap(), 0, str );
return NULL;
}