From 152b7975968cea9e11f707ca5e1a233c9de99cf7 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Wed, 7 Jan 2015 21:48:28 +0900 Subject: 34144: allocate origline by ztrdup(), not by dupstring() If origline is allocated in heap, it will have been freed when menuselect() is called directly as a widget. --- Src/Zle/complist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/Zle/complist.c') diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 80e5bf9d1..f54206619 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -2884,7 +2884,8 @@ domenuselect(Hookdef dummy, Chdata dat) brend = dupbrinfo(u->brend, &lastbrend, 0); nbrbeg = u->nbrbeg; nbrend = u->nbrend; - origline = u->origline; + zsfree(origline); + origline = ztrdup(u->origline); origcs = u->origcs; origll = u->origll; strcpy(status, u->status); @@ -3238,7 +3239,8 @@ domenuselect(Hookdef dummy, Chdata dat) * don't want that, just what the user typed, * so restore the information. */ - origline = modeline; + zsfree(origline); + origline = ztrdup(modeline); origcs = modecs; origll = modell; zlemetacs = 0; -- cgit 1.4.1