about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2015-01-05 14:20:06 +0100
committerMikael Magnusson <mikachu@gmail.com>2015-01-06 23:47:05 +0100
commit8035794a56eec3539fb1080ca3818237ed504349 (patch)
treec8f92aeab976f01a23da2e9eb3775a6c6614d533
parent6c72895bc2e8fc3a6bc98ba089390b4d2fb12dde (diff)
downloadzsh-8035794a56eec3539fb1080ca3818237ed504349.tar.gz
zsh-8035794a56eec3539fb1080ca3818237ed504349.tar.xz
zsh-8035794a56eec3539fb1080ca3818237ed504349.zip
34119: complist: Fix leak of string in clnicezputs
Found by Coverity (Issue 1255808).
-rw-r--r--ChangeLog2
-rw-r--r--Src/Zle/complist.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 72013066d..4f58df1fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-01-06  Mikael Magnusson  <mikachu@gmail.com>
 
+	* 34119: Src/Zle/complist.c: Fix leak of string in clnicezputs
+
 	* 34105: Src/subst.c: remove dead code
 
 	* 34121: Src/Zle/compresult.c: Remove unneeded NULL check
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index b6e7e30e9..80e5bf9d1 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -780,6 +780,7 @@ clnicezputs(int do_colors, char *s, int ml)
 	    /* Is the screen full? */
 	    if (ml == mlend - 1 && col == zterm_columns - 1) {
 		mlprinted = ml - oml;
+		free(ums);
 		return 0;
 	    }
 	    if (t < wptr) {
@@ -804,6 +805,7 @@ clnicezputs(int do_colors, char *s, int ml)
 		ml++;
 		if (mscroll && !--mrestlines && (ask = asklistscroll(ml))) {
 		    mlprinted = ml - oml;
+		    free(ums);
 		    return ask;
 		}
 		col -= zterm_columns;