diff options
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"); |
