diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-03 14:26:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-03 14:26:55 +0000 |
commit | 11f3d60016d0a4de4014121ff35d6d1b7d6817bf (patch) | |
tree | 268c999137bbb23843a535f6191e5b115699170f /usr.sbin/pstat/pstat.c | |
parent | 90562873806dad0660901e9b9d25801343dd0af8 (diff) |
malloc(n * m) -> calloc(n, m); ok espie
Diffstat (limited to 'usr.sbin/pstat/pstat.c')
-rw-r--r-- | usr.sbin/pstat/pstat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index fb1aefe54d4..04141890214 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pstat.c,v 1.65 2007/09/02 15:19:40 deraadt Exp $ */ +/* $OpenBSD: pstat.c,v 1.66 2007/09/03 14:26:54 deraadt Exp $ */ /* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 from: static char sccsid[] = "@(#)pstat.c 8.9 (Berkeley) 2/16/94"; #else -static char *rcsid = "$OpenBSD: pstat.c,v 1.65 2007/09/02 15:19:40 deraadt Exp $"; +static char *rcsid = "$OpenBSD: pstat.c,v 1.66 2007/09/03 14:26:54 deraadt Exp $"; #endif #endif /* not lint */ @@ -716,8 +716,8 @@ kinfo_vnodes(int *avnodes) err(1, "sysctl(KERN_NUMVNODES) failed"); } else KGET(V_NUMV, numvnodes); - if ((vbuf = malloc((numvnodes + 20) * - (sizeof(struct vnode *) + sizeof(struct vnode)))) == NULL) + if ((vbuf = calloc(numvnodes + 20, + sizeof(struct vnode *) + sizeof(struct vnode))) == NULL) err(1, "malloc: vnode buffer"); bp = vbuf; evbuf = vbuf + (numvnodes + 20) * |