about summary refs log tree commit diff
path: root/Src/Zle/zle_params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-03-27 17:55:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-03-27 17:55:41 +0000
commite4059eedc7e825c0711981d4035ab138b1fb21e4 (patch)
tree670f47fc89f98048c11dd68179f57e96ed10338d /Src/Zle/zle_params.c
parentee52e3c34967e894ce0adf924da12f7962852ce2 (diff)
downloadzsh-e4059eedc7e825c0711981d4035ab138b1fb21e4.tar.gz
zsh-e4059eedc7e825c0711981d4035ab138b1fb21e4.tar.xz
zsh-e4059eedc7e825c0711981d4035ab138b1fb21e4.zip
Mikael: 28941: fix $CURSOR access when metafied
Diffstat (limited to 'Src/Zle/zle_params.c')
-rw-r--r--Src/Zle/zle_params.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 1a23d3c67..3fdb5f8ed 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -230,8 +230,10 @@ get_cursor(UNUSED(Param pm))
 	/* A lot of work for one number, but still... */
 	ZLE_STRING_T tmpline;
 	int tmpcs, tmpll, tmpsz;
-	tmpline = stringaszleline(zlemetaline, zlemetacs,
+	char *tmpmetaline = ztrdup(zlemetaline);
+	tmpline = stringaszleline(tmpmetaline, zlemetacs,
 				  &tmpll, &tmpsz, &tmpcs);
+	free(tmpmetaline);
 	free(tmpline);
 	return tmpcs;
     }