diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-29 16:38:24 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-29 16:38:24 +0000 |
commit | 8ca247aae74e09e6ab0c9565863007e3a16095cd (patch) | |
tree | 4e66e921d88dd26f909d8535a330bdeedde1c94b | |
parent | bf54356c9efa4f3aba3c6b626d1712e6d9537264 (diff) |
use calloc, from Benjamin Baier
-rw-r--r-- | usr.sbin/config/util.c | 5 |
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); } |