about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_tricky.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b02d785b..6f351250e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-09-08  Clint Adams  <clint@zsh.org>
 
+	* 25636: Src/Zle/zle_tricky.c: free s before returning with an
+	error condition.
+
 	* 25634: Src/Zle/zle_main.c: free t before returning if both t and
 	errflag are set.
 
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)