diff options
| author | 2014-07-04 22:39:31 +0000 | |
|---|---|---|
| committer | 2014-07-04 22:39:31 +0000 | |
| commit | 19fa5b25c249abe2e228d684ce18cdd8363fa85b (patch) | |
| tree | 9cfaf8fa125b7d0801bdf3b6bab15957224ff12a /usr.sbin/rtadvd/timer.c | |
| parent | malloc+memset -> calloc (diff) | |
| download | wireguard-openbsd-19fa5b25c249abe2e228d684ce18cdd8363fa85b.tar.xz wireguard-openbsd-19fa5b25c249abe2e228d684ce18cdd8363fa85b.zip | |
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"); |
