summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2017-11-02 06:55:35 +0000
committertb <tb@openbsd.org>2017-11-02 06:55:35 +0000
commite1b6fda66c32022e3d5f8b7edae62a06ff336885 (patch)
tree6672b5237081bf4fe950cc6ad6eeb4bc292415e0
parentopenssl s_time -connect host:port needs dns promise for pledge(2) otherwise it (diff)
downloadwireguard-openbsd-e1b6fda66c32022e3d5f8b7edae62a06ff336885.tar.xz
wireguard-openbsd-e1b6fda66c32022e3d5f8b7edae62a06ff336885.zip
Switch calloc(3) back to malloc(3). The call to calloc was introduced
by the plaintext history diff, but the code that may have depended on this was since removed from history.c. None of the code introduced between the plaintext history commit and now depends on calloc(3). This way we can again use malloc.conf(5)'s J option to recognize use of uninitialized memory. ok jca
-rw-r--r--bin/ksh/alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/alloc.c b/bin/ksh/alloc.c
index e1de35af5fa..e3129bfe1fe 100644
--- a/bin/ksh/alloc.c
+++ b/bin/ksh/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.17 2017/08/15 17:57:57 jca Exp $ */
+/* $OpenBSD: alloc.c,v 1.18 2017/11/02 06:55:35 tb Exp $ */
/* Public domain, like most of the rest of ksh */
@@ -47,7 +47,7 @@ alloc(size_t size, Area *ap)
if (size > SIZE_MAX - sizeof(struct link))
internal_errorf(1, "unable to allocate memory");
- l = calloc(1, sizeof(struct link) + size);
+ l = malloc(sizeof(struct link) + size);
if (l == NULL)
internal_errorf(1, "unable to allocate memory");
l->next = ap->freelist;