summaryrefslogtreecommitdiffstats
path: root/history.c
diff options
context:
space:
mode:
Diffstat (limited to 'history.c')
-rw-r--r--history.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/history.c b/history.c
index 5e2144e..f933272 100644
--- a/history.c
+++ b/history.c
@@ -39,12 +39,15 @@ history_free(struct history *history)
struct link *iter, *next;
struct inputln *ln;
- for (iter = &history->list; iter; iter = next) {
+ for (iter = history->list.next; iter; iter = next) {
next = iter->next;
ln = UPCAST(iter, struct inputln);
free(ln);
}
- free(history->cmd);
+ history->list = LIST_HEAD;
+ free(history->query);
+ history->query = NULL;
+ history->cmd = NULL;
}
struct inputln *