Fix crash bug in smbclient completion. Closes bug #659.
authorTim Potter <tpot@samba.org>
Tue, 4 Nov 2003 22:38:58 +0000 (22:38 +0000)
committerTim Potter <tpot@samba.org>
Tue, 4 Nov 2003 22:38:58 +0000 (22:38 +0000)
(This used to be commit 4480058d85ebe9175c4720c18100b459877dbd07)

source3/client/client.c

index ecece8942ec74e5ff9cac2ce8ee62cf8c09e5226..5ee6913374a529a9320bdd182a7a59e167e103a8 100644 (file)
@@ -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;
        }