summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/getnetgrent.c4
-rw-r--r--lib/libc/gen/login_cap.c4
-rw-r--r--lib/libc/gen/scandir.c4
-rw-r--r--lib/libc/gen/setmode.c4
-rw-r--r--lib/libc/gen/strtofflags.c4
5 files changed, 10 insertions, 10 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index 51493ed422c..937ce158d1e 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetgrent.c,v 1.18 2007/03/05 20:29:14 millert Exp $ */
+/* $OpenBSD: getnetgrent.c,v 1.19 2007/09/02 15:19:16 deraadt Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@@ -88,7 +88,7 @@ _ng_sl_init(void)
sl->sl_cur = 0;
sl->sl_max = 20;
- sl->sl_str = malloc(sl->sl_max * sizeof(char *));
+ sl->sl_str = calloc(sl->sl_max, sizeof(char *));
if (sl->sl_str == NULL)
return NULL;
return sl;
diff --git a/lib/libc/gen/login_cap.c b/lib/libc/gen/login_cap.c
index de8b048c349..fb6a7e0df8b 100644
--- a/lib/libc/gen/login_cap.c
+++ b/lib/libc/gen/login_cap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_cap.c,v 1.26 2006/04/09 04:40:35 deraadt Exp $ */
+/* $OpenBSD: login_cap.c,v 1.27 2007/09/02 15:19:16 deraadt Exp $ */
/*
* Copyright (c) 2000-2004 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -180,7 +180,7 @@ login_getstyle(login_cap_t *lc, char *style, char *atype)
while (*ta)
if (*ta++ == ',')
++i;
- f2 = authtypes = malloc(sizeof(char *) * i);
+ f2 = authtypes = calloc(sizeof(char *), i);
if (!authtypes) {
syslog(LOG_ERR, "malloc: %m");
free(f1);
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 089ad19e0da..2ad8c3e612e 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scandir.c,v 1.11 2007/06/26 05:00:50 ray Exp $ */
+/* $OpenBSD: scandir.c,v 1.12 2007/09/02 15:19:16 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -78,7 +78,7 @@ scandir(const char *dirname, struct dirent ***namelist,
errno = ENOMEM;
goto fail;
}
- names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *));
+ names = (struct dirent **)calloc(arraysz, sizeof(struct dirent *));
if (names == NULL)
goto fail;
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index 843b46183c9..9cc2cbc59ba 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setmode.c,v 1.19 2006/03/12 18:36:46 otto Exp $ */
+/* $OpenBSD: setmode.c,v 1.20 2007/09/02 15:19:16 deraadt Exp $ */
/* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */
/*
@@ -187,7 +187,7 @@ setmode(const char *p)
setlen = SET_LEN + 2;
- if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL)
+ if ((set = calloc((u_int)sizeof(BITCMD), setlen)) == NULL)
return (NULL);
saveset = set;
endset = set + (setlen - 2);
diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c
index 9eba0f4517d..a54fd2ce843 100644
--- a/lib/libc/gen/strtofflags.c
+++ b/lib/libc/gen/strtofflags.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtofflags.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: strtofflags.c,v 1.6 2007/09/02 15:19:16 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -82,7 +82,7 @@ fflagstostr(u_int32_t flags)
u_int32_t setflags;
int i;
- if ((string = (char *)malloc(nmappings * (longestflaglen + 1))) == NULL)
+ if ((string = (char *)calloc(nmappings, longestflaglen + 1)) == NULL)
return (NULL);
setflags = flags;