From e98b3c1e97421e8757af8c19c3d2738cbe301555 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 27 Aug 2007 10:16:54 +0000 Subject: r24698: Patch from Andrew Kroeger to fix Bug #4521: smbclient crashes during tab completion when tab hit twice. The readline magic is beyond me, but this seems to do the trick. Andrew Bartlett (This used to be commit e05f3450ecc3f99509fbc069b09d402e3b6d7564) --- source4/client/client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source4/client/client.c b/source4/client/client.c index a10d4254a3a..1fdbec4bfd0 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -2922,9 +2922,10 @@ static char **completion_fn(const char *text, int start, int end) return matches; cleanup: - while (i >= 0) { - free(matches[i]); - i--; + count--; + while (count >= 0) { + free(matches[count]); + count--; } free(matches); return NULL; -- cgit