about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2014-08-01 16:15:13 +0100
committerPeter Stephenson <pws@zsh.org>2014-08-01 16:15:13 +0100
commitb79ef8caaf00d5fb26fa968fd2789a3f969ab22c (patch)
tree9f1e0111c9ef462d5ee7820aab9b0897d642260e /Src/utils.c
parent417cb94fe147a94d16e3935deb83250a51cd62a8 (diff)
downloadzsh-b79ef8caaf00d5fb26fa968fd2789a3f969ab22c.tar.gz
zsh-b79ef8caaf00d5fb26fa968fd2789a3f969ab22c.tar.xz
zsh-b79ef8caaf00d5fb26fa968fd2789a3f969ab22c.zip
32932: add hmkarray() and use to fix leak
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Src/utils.c b/Src/utils.c
index aa978e6b9..998e46a36 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3372,6 +3372,17 @@ mkarray(char *s)
 }
 
 /**/
+mod_export char **
+hmkarray(char *s)
+{
+    char **t = (char **) zhalloc((s) ? (2 * sizeof s) : (sizeof s));
+
+    if ((*t = s))
+	t[1] = NULL;
+    return t;
+}
+
+/**/
 mod_export void
 zbeep(void)
 {