summaryrefslogtreecommitdiff
path: root/usr.bin/ipcs
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-02 23:50:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-02 23:50:05 +0000
commit03059e279945b4acbfbc6fc65c70c7d1ba77bb55 (patch)
tree105f0ad8a4c221d0b5cf3ab631a67266dc8fa22b /usr.bin/ipcs
parent34bab3a7fcc73c4a4de55b918cebcbbcc95ff927 (diff)
more malloc(n * m) -> calloc(n, m); from Igor Zinovik
Diffstat (limited to 'usr.bin/ipcs')
-rw-r--r--usr.bin/ipcs/ipcs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c
index 108d72df021..b08b0bc8605 100644
--- a/usr.bin/ipcs/ipcs.c
+++ b/usr.bin/ipcs/ipcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipcs.c,v 1.21 2005/02/22 14:47:45 jmc Exp $ */
+/* $OpenBSD: ipcs.c,v 1.22 2007/09/02 23:50:04 deraadt Exp $ */
/* $NetBSD: ipcs.c,v 1.25 2000/06/16 03:58:20 simonb Exp $ */
/*-
@@ -718,10 +718,10 @@ ipcs_kvm(void)
errx(1, "kvm_read (%s): %s",
symbols[X_MSQIDS].n_name, kvm_geterr(kd));
- msqids = malloc(sizeof(struct msqid_ds) *
+ msqids = calloc(sizeof(struct msqid_ds),
msginfo.msgmni);
if (msqids == NULL)
- err(1, "malloc");
+ err(1, "calloc");
if (kvm_read(kd, addr, msqids,
sizeof(struct msqid_ds) * msginfo.msgmni) !=
@@ -770,10 +770,10 @@ ipcs_kvm(void)
errx(1, "kvm_read (%s): %s",
symbols[X_SHMSEGS].n_name, kvm_geterr(kd));
- shmsegs = malloc(sizeof(struct shmid_ds *) *
+ shmsegs = calloc(sizeof(struct shmid_ds *),
shminfo.shmmni);
if (shmsegs == NULL)
- err(1, "malloc");
+ err(1, "calloc");
if (kvm_read(kd, addr, shmsegs,
sizeof(struct shmid_ds *) * shminfo.shmmni) !=
@@ -824,10 +824,10 @@ ipcs_kvm(void)
errx(1, "kvm_read (%s): %s",
symbols[X_SEMA].n_name, kvm_geterr(kd));
- sema = malloc(sizeof(struct semid_ds *) *
+ sema = calloc(sizeof(struct semid_ds *),
seminfo.semmni);
if (sema == NULL)
- err(1, "malloc");
+ err(1, "calloc");
if (kvm_read(kd, addr, sema,
sizeof(struct semid_ds *) * seminfo.semmni) !=