about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2017-02-13 16:45:31 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2017-02-13 18:09:34 -0800
commit63f086d167960a27ecdbcb762179e2c2bf8a29f5 (patch)
tree178da0da015c81baf5ac8e8a7c1dfc4697d4fd38
parente720f459759ce8e7812cca9dad140ef188432b40 (diff)
downloadzsh-63f086d167960a27ecdbcb762179e2c2bf8a29f5.tar.gz
zsh-63f086d167960a27ecdbcb762179e2c2bf8a29f5.tar.xz
zsh-63f086d167960a27ecdbcb762179e2c2bf8a29f5.zip
40524: do not free a null array
-rw-r--r--ChangeLog2
-rw-r--r--Src/Modules/example.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fe1da1a51..1ab392d88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
 	* 40539: Fabian Klotzl: Completion/Unix/Command/_gcc: typo in MIPS
 	branch of argument selection
 
+	* 40524: Src/Modules/example.c: do not free a null array
+
 2017-02-13  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 40537: Doc/Zsh/builtins.yo: document the foregoing.
diff --git a/Src/Modules/example.c b/Src/Modules/example.c
index 45ca2cffa..c80c9e7b2 100644
--- a/Src/Modules/example.c
+++ b/Src/Modules/example.c
@@ -69,7 +69,8 @@ bin_example(char *nam, char **args, Options ops, UNUSED(int func))
     intparam = i;
     zsfree(strparam);
     strparam = ztrdup(*oargs ? *oargs : "");
-    freearray(arrparam);
+    if (arrparam)
+	freearray(arrparam);
     arrparam = zarrdup(oargs);
     return 0;
 }