diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-04 22:39:32 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-04 22:39:32 +0000 |
commit | 6097cb332d18be0b620a77386e97d76c8c3aeeed (patch) | |
tree | 44b31ceee3f27df79f712e1f40ec38f863a5862b /usr.sbin/rtadvd/timer.c | |
parent | 2c7f05db0563620f99ba1ae1fcceb029d9ce0291 (diff) |
malloc+memset -> calloc
from Benjamin Baier (programmer (at) netzbasis.de)
Diffstat (limited to 'usr.sbin/rtadvd/timer.c')
-rw-r--r-- | usr.sbin/rtadvd/timer.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c index 249a50d181b..56455423ca6 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.11 2013/04/30 12:30:40 florian Exp $ */ +/* $OpenBSD: timer.c,v 1.12 2014/07/04 22:39:31 guenther Exp $ */ /* $KAME: timer.c,v 1.7 2002/05/21 14:26:55 itojun Exp $ */ /* @@ -48,10 +48,8 @@ rtadvd_add_timer(void (*timeout)(void *), { struct rtadvd_timer *newtimer; - if ((newtimer = malloc(sizeof(*newtimer))) == NULL) - fatal("malloc"); - - memset(newtimer, 0, sizeof(*newtimer)); + if ((newtimer = calloc(1, sizeof(*newtimer))) == NULL) + fatal("calloc"); if (timeout == NULL) fatalx("timeout function unspecified"); |