summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-29 16:38:24 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-29 16:38:24 +0000
commit8ca247aae74e09e6ab0c9565863007e3a16095cd (patch)
tree4e66e921d88dd26f909d8535a330bdeedde1c94b
parentbf54356c9efa4f3aba3c6b626d1712e6d9537264 (diff)
use calloc, from Benjamin Baier
-rw-r--r--usr.sbin/config/util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/config/util.c b/usr.sbin/config/util.c
index 9bd15a81b12..a571697a0e0 100644
--- a/usr.sbin/config/util.c
+++ b/usr.sbin/config/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.14 2014/05/18 09:29:54 espie Exp $ */
+/* $OpenBSD: util.c,v 1.15 2014/05/29 16:38:23 tedu Exp $ */
/* $NetBSD: util.c,v 1.5 1996/08/31 20:58:29 mycroft Exp $ */
/*
@@ -62,9 +62,8 @@ emalloc(size_t size)
{
void *p;
- if ((p = malloc(size)) == NULL)
+ if ((p = calloc(1, size)) == NULL)
nomem();
- memset(p, 0, size);
return (p);
}