diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-04 22:33:44 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-04 22:33:44 +0000 |
commit | 2c7f05db0563620f99ba1ae1fcceb029d9ce0291 (patch) | |
tree | b77fd7ff3e851bc19e360d745320a5cee79f6fa9 | |
parent | bdbb65ce792bd7c4e66f4f2585c8122d4ffb1565 (diff) |
malloc+memset -> calloc
from Benjamin Baier (programmer (at) netzbasis.de)
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 7758a49d2b5..464d8c2e0bc 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsold.c,v 1.50 2013/10/21 08:46:07 phessler Exp $ */ +/* $OpenBSD: rtsold.c,v 1.51 2014/07/04 22:33:43 guenther Exp $ */ /* $KAME: rtsold.c,v 1.75 2004/01/03 00:00:07 itojun Exp $ */ /* @@ -324,12 +324,11 @@ ifconfig(char *ifname) return(-1); } - if ((ifinfo = malloc(sizeof(*ifinfo))) == NULL) { + if ((ifinfo = calloc(1, sizeof(*ifinfo))) == NULL) { warnmsg(LOG_ERR, __func__, "memory allocation failed"); free(sdl); return(-1); } - memset(ifinfo, 0, sizeof(*ifinfo)); ifinfo->sdl = sdl; strncpy(ifinfo->ifname, ifname, sizeof(ifinfo->ifname)); |