Commit 4397e995 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 98934f20
......@@ -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 );
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment