about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_hist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 53481bd80..9719e5418 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -996,7 +996,7 @@ getvisrchstr(void)
 	    visrchstr = metafy(sbuf + 1, sptr - 1, META_DUP);
 	    if (!strlen(visrchstr)) {
 	        zsfree(visrchstr);
-		visrchstr = vipenultsrchstr;
+		visrchstr = ztrdup(vipenultsrchstr);
 	    }
 	    ret = 1;
 	    sptr = 0;