1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s4:registry: Fix size type and loop

This fixes compilation with -Wstrict-overflow=2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andreas Schneider 2018-03-21 16:46:49 +01:00 committed by Jeremy Allison
parent bc3834d691
commit c4a73ccd8f

View File

@ -428,7 +428,7 @@ static char **reg_complete_command(const char *text, int start, int end)
/* Complete command */
char **matches;
size_t len, samelen=0;
int i, count=1;
size_t i, count = 1;
matches = malloc_array_p(char *, MAX_COMPLETIONS);
if (!matches) return NULL;
@ -463,10 +463,8 @@ static char **reg_complete_command(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;