about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-29 08:20:59 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-29 08:20:59 +0000
commitf4f38507e54ad19ea28395f977637bb3f014c9dc (patch)
tree716b03f3caf72a35a53ced65469d5a91c0e55bd8 /Src
parent84fd4cb6e6980ea2773039b996e486d48c69334b (diff)
downloadzsh-f4f38507e54ad19ea28395f977637bb3f014c9dc.tar.gz
zsh-f4f38507e54ad19ea28395f977637bb3f014c9dc.tar.xz
zsh-f4f38507e54ad19ea28395f977637bb3f014c9dc.zip
fix for unbalanced calls to {push,pop}heap in docomplete()/get_comp_string() (12717)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 63978175d..f9ba965db 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -581,7 +581,8 @@ docomplete(int lst)
     qisuf = ztrdup("");
     zsfree(autoq);
     autoq = NULL;
-    /* Get the word to complete. */
+    /* Get the word to complete.
+     * NOTE: get_comp_string() calls pushheap(), but not popheap(). */
     noerrs = 1;
     s = get_comp_string();
     DPUTS(wb < 0 || cs < wb || cs > we,
@@ -603,6 +604,7 @@ docomplete(int lst)
 	    strcpy((char *) line, ol);
 	    ll = strlen((char *) line);
 	    cs = ocs;
+	    popheap();
 	    unmetafy_line();
 	    zsfree(s);
 	    zsfree(qword);