If there a glob is expanded to more than one result while attempting
to complete the command word, the matches are discarded but not freed.

diff --git a/bashline.c b/bashline.c
index 0e5373ab..07f38e62 100644
--- a/bashline.c
+++ b/bashline.c
@@ -2192,7 +2192,11 @@ globword:
    local_index = 0;

    if (glob_matches[1] && rl_completion_type == TAB) /* multiple
matches are bad */
-     return ((char *)NULL);
+     {
+       strvec_dispose (glob_matches);
+       glob_matches = (char **)NULL;
+       return ((char *)NULL);
+     }
  }

Reply via email to