-/* $OpenBSD: bioctl.c,v 1.119 2014/01/18 09:11:12 jsing Exp $ */
+/* $OpenBSD: bioctl.c,v 1.120 2014/04/22 20:42:01 tedu Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
} else
#endif /* AOE */
{
- dt = (dev_t *)malloc(BIOC_CRMAXLEN);
+ dt = calloc(1, BIOC_CRMAXLEN);
if (!dt)
err(1, "not enough memory for dev_t list");
- memset(dt, 0, BIOC_CRMAXLEN);
no_dev = bio_parse_devlist(dev_list, dt);
}
-/* $OpenBSD: dmesg.c,v 1.22 2010/07/02 22:02:06 deraadt Exp $ */
+/* $OpenBSD: dmesg.c,v 1.23 2014/04/22 20:43:12 tedu Exp $ */
/* $NetBSD: dmesg.c,v 1.8 1995/03/18 14:54:49 cgd Exp $ */
/*-
err(1, "sysctl: KERN_MSGBUFSIZE");
msgbufsize += sizeof(struct msgbuf) - 1;
- bufdata = malloc(msgbufsize);
+ bufdata = calloc(1, msgbufsize);
if (bufdata == NULL)
errx(1, "couldn't allocate space for buffer data");
- memset(bufdata, 0, msgbufsize);
mib[1] = KERN_MSGBUF;
len = msgbufsize;
if (sysctl(mib, 2, bufdata, &len, NULL, 0))