about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-09-08 22:17:50 +0000
committerClint Adams <clint@users.sourceforge.net>2008-09-08 22:17:50 +0000
commitb4ee5adc251faffae472fb176214789327bf63b7 (patch)
tree39be0bc4e7afa9f68edcb51a3a269c866724e668 /Src
parentc715630baa75d5d65c68de3df852164342ff130c (diff)
downloadzsh-b4ee5adc251faffae472fb176214789327bf63b7.tar.gz
zsh-b4ee5adc251faffae472fb176214789327bf63b7.tar.xz
zsh-b4ee5adc251faffae472fb176214789327bf63b7.zip
25636: free s before returning with an error condition.
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 4786f30de..bc0152401 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2834,8 +2834,14 @@ expandcmdpath(UNUSED(char **args))
     noaliases = 1;
     s = getcurcmd();
     noaliases = na;
-    if (!s || cmdwb < 0 || cmdwe < cmdwb)
+    if (!s)
+	return 1;
+
+    if (cmdwb < 0 || cmdwe < cmdwb) {
+	zsfree(s);
 	return 1;
+    }
+
     str = findcmd(s, 1);
     zsfree(s);
     if (!str)