Skip to content

Commit

Permalink
s4:client: Fix size types and loop
Browse files Browse the repository at this point in the history
This fixes compilation with -Wstrict-overflow=2.

Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
cryptomilk authored and jrasamba committed Apr 3, 2018
1 parent c4a73cc commit 28dec65
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions source4/client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3053,7 +3053,7 @@ static char **completion_fn(const char *text, int start, int end)
return NULL;
} else {
char **matches;
int i, len, samelen = 0, count=1;
size_t i, len, samelen = 0, count=1;

matches = malloc_array_p(char *, MAX_COMPLETIONS);
if (!matches) return NULL;
Expand Down Expand Up @@ -3092,10 +3092,8 @@ static char **completion_fn(const char *text, int start, int end)
return matches;

cleanup:
count--;
while (count >= 0) {
free(matches[count]);
count--;
for (i = 0; i < count; i++) {
free(matches[i]);
}
free(matches);
return NULL;
Expand Down

0 comments on commit 28dec65

Please sign in to comment.