--- readline-5.2/complete.c 2006-07-28 17:35:49.000000000 +0200 +++ readline-5.2-fixed/complete.c 2007-07-27 16:57:02.000000000 +0200 @@ -961,6 +961,7 @@ if (rl_attempted_completion_function) { matches = (*rl_attempted_completion_function) (text, start, end); + if (matches && ! matches[0]) { + free(matches); + matches = 0; + } if (matches || rl_attempted_completion_over) {