From 94014ff65bc2bdd752717792b156cdfcbc5b5c98 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 18 May 2017 09:33:08 +0100 Subject: 41113 (tweaked): Save current line linkage to history ring. When saving history state save whether the current history line is linked into the ring and remove it, and restore as appropriate later. This avoids surprises where the history ring is freed and incorrectly frees the current state in curline, which has a different allocation strategy. Original patch tweaked to make restoring more logical. --- Src/hashtable.c | 1 + 1 file changed, 1 insertion(+) (limited to 'Src/hashtable.c') diff --git a/Src/hashtable.c b/Src/hashtable.c index ba5faad91..c34744cd8 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -1448,6 +1448,7 @@ freehistdata(Histent he, int unlink) if (!(he->node.flags & (HIST_DUP | HIST_TMPSTORE))) removehashnode(histtab, he->node.nam); + DPUTS(he->node.nam == chline, "Attempt to free chline in history data"); zsfree(he->node.nam); if (he->nwords) zfree(he->words, he->nwords*2*sizeof(short)); -- cgit 1.4.1