summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/parameter.c5
-rw-r--r--Src/Zle/compresult.c2
-rw-r--r--Src/builtin.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index bdced0680..d7c3ba690 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -192,9 +192,10 @@ scanpmparameters(HashTable ht, ScanFunc func, int flags)
 static void
 setpmcommand(Param pm, char *value)
 {
-    if (isset(RESTRICTED))
+    if (isset(RESTRICTED)) {
 	zwarn("restricted: %s", value, 0);
-    else {
+	zsfree(value);
+    } else {
 	Cmdnam cn = zcalloc(sizeof(*cn));
 
 	cn->flags = HASHED;
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 1e807a93d..7e2e564f1 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1168,7 +1168,7 @@ void
 comp_list(char *v)
 {
     zsfree(complist);
-    complist = ztrdup(v);
+    complist = v;
 
     onlyexpl = (v ? ((strstr(v, "expl") ? 1 : 0) |
 		     (strstr(v, "messages") ? 2 : 0)) : 0);
diff --git a/Src/builtin.c b/Src/builtin.c
index 560855b9e..e6e89faef 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2162,7 +2162,7 @@ mkautofn(Shfunc shf)
     p->strs = NULL;
     p->shf = shf;
     p->npats = 0;
-    p->pats = NULL;
+    p->pats = (Patprog *) p->prog;
     p->flags = EF_REAL;
     p->dump = NULL;