about summary refs log tree commit diff
path: root/Src/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 5b0fe0309..842863992 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -922,6 +922,10 @@ prepnexthistent(void)
 
     if (curline_in_ring)
 	unlinkcurline();
+    if (hist_ring && hist_ring->flags & HIST_TMPSTORE) {
+	curhist--;
+	freehistnode((HashNode)hist_ring);
+    }
 
     if (histlinect < histsiz) {
 	he = (Histent)zcalloc(sizeof *he);