diff options
author | Peter Stephenson <pws@zsh.org> | 2017-05-26 11:06:59 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2017-05-30 09:39:32 +0100 |
commit | 151a4660e289c66d13b65d68ad2f10d93743d2d4 (patch) | |
tree | 334910edf8779486bbb39374ea827ea082bca1e0 /Src/hashtable.c | |
parent | 284b5aaeb08f90520ac7dc385e8921471678e7dd (diff) | |
download | zsh-151a4660e289c66d13b65d68ad2f10d93743d2d4.tar.gz zsh-151a4660e289c66d13b65d68ad2f10d93743d2d4.tar.xz zsh-151a4660e289c66d13b65d68ad2f10d93743d2d4.zip |
41164: Don't free a history entry if it's curline.
This replaces 41113 / 94014ff65b with a simple local change for the immediate problem. It's not entirely clear if this reflects wider changes in the structure of the history code.
Diffstat (limited to 'Src/hashtable.c')
-rw-r--r-- | Src/hashtable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c index c34744cd8..6ec2ed220 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -1445,10 +1445,12 @@ freehistdata(Histent he, int unlink) if (!he) return; + if (he == &curline) + return; + 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)); |