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:
parent
bc3834d691
commit
c4a73ccd8f
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user