diff options
author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2015-01-07 21:48:28 +0900 |
---|---|---|
committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2015-01-07 21:48:28 +0900 |
commit | 152b7975968cea9e11f707ca5e1a233c9de99cf7 (patch) | |
tree | 78d8ff2dd0e32dfded120b43b7a3a2ba2cc76ca1 | |
parent | b11f7a7e3028420d027e71713d5ec1cae0451fbb (diff) | |
download | zsh-152b7975968cea9e11f707ca5e1a233c9de99cf7.tar.gz zsh-152b7975968cea9e11f707ca5e1a233c9de99cf7.tar.xz zsh-152b7975968cea9e11f707ca5e1a233c9de99cf7.zip |
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.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Zle/complist.c | 6 | ||||
-rw-r--r-- | Src/Zle/zle_tricky.c | 3 |
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index d31095b70..b5710fa6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-01-07 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 34144: Src/Zle/zle_tricky.c, Src/Zle/complist.c: allocate + origline by ztrdup(), not by dupstring() + 2015-01-06 Barton E. Schaefer <schaefer@zsh.org> * 34122: Src/module.c: allow NULL third argument as intended 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; diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 864f804b7..950c22f38 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -634,7 +634,8 @@ docomplete(int lst) metafy_line(); ocs = zlemetacs; - origline = dupstring(zlemetaline); + zsfree(origline); + origline = ztrdup(zlemetaline); origcs = zlemetacs; origll = zlemetall; if (!isfirstln && (chline != NULL || zle_chline != NULL)) { |