summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/client.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index ecece8942e..5ee6913374 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2403,10 +2403,9 @@ static char **completion_fn(const char *text, int start, int end)
return matches;
cleanup:
- while (i >= 0) {
+ for (i = 0; i < count; i++)
free(matches[i]);
- i--;
- }
+
free(matches);
return NULL;
}