aboutsummaryrefslogtreecommitdiff
path: root/ask.c
diff options
context:
space:
mode:
Diffstat (limited to 'ask.c')
-rw-r--r--ask.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ask.c b/ask.c
index 7ea4de5..1c4fb4f 100644
--- a/ask.c
+++ b/ask.c
@@ -121,6 +121,7 @@ static int draw_line(FILE *out, const char *line, const char *patt, int cursor)
}
}
if (backtrack) fprintf(out, "\033[0m\033[%dD", backtrack);
+ free(cache);
return to_start;
}
@@ -292,6 +293,7 @@ static char *get_input(FILE *in, FILE *out, const char *prompt, const char *init
if (backtrack || prompt[0])
fprintf(out, "\033[%dD", backtrack + (int)strlen(prompt));
fputs("\033[0m\033[K", out);
+ if (picked != buf && buf) free(buf);
return picked;
}