summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c8
-rw-r--r--libexec/ld.so/ldconfig/prebind.c6
-rw-r--r--libexec/spamd-setup/spamd-setup.c6
-rw-r--r--libexec/spamd/sdl.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index dc9ad211d89..21579c44ab1 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.180 2007/07/31 03:35:04 ray Exp $ */
+/* $OpenBSD: ftpd.c,v 1.181 2007/09/02 15:19:20 deraadt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -70,7 +70,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#else
static const char rcsid[] =
- "$OpenBSD: ftpd.c,v 1.180 2007/07/31 03:35:04 ray Exp $";
+ "$OpenBSD: ftpd.c,v 1.181 2007/09/02 15:19:20 deraadt Exp $";
#endif
#endif /* not lint */
@@ -439,8 +439,8 @@ main(int argc, char *argv[])
for (res = res0; res; res = res->ai_next)
n++;
- fds = malloc(n * sizeof(int));
- pfds = malloc(n * sizeof(struct pollfd));
+ fds = calloc(n, sizeof(int));
+ pfds = calloc(n, sizeof(struct pollfd));
if (!fds || !pfds) {
syslog(LOG_ERR, "%s", strerror(errno));
exit(1);
diff --git a/libexec/ld.so/ldconfig/prebind.c b/libexec/ld.so/ldconfig/prebind.c
index c4d2080fddc..2fdfc09dce0 100644
--- a/libexec/ld.so/ldconfig/prebind.c
+++ b/libexec/ld.so/ldconfig/prebind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prebind.c,v 1.8 2006/11/13 13:13:14 drahn Exp $ */
+/* $OpenBSD: prebind.c,v 1.9 2007/09/02 15:19:20 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com>
*
@@ -625,7 +625,7 @@ elf_load_object(void *pexe, const char *name)
object->dyn.strtab = str;
strt = str;
- sym = malloc(object->nchains * sizeof(Elf_Sym));
+ sym = calloc(object->nchains, sizeof(Elf_Sym));
if (sym == NULL) {
printf("unable to allocate symtab for %s\n",
name);
@@ -1410,7 +1410,7 @@ void
elf_init_objarray(void)
{
objarray_sz = 512;
- objarray = xmalloc(sizeof (objarray[0]) * objarray_sz);
+ objarray = xcalloc(sizeof (objarray[0]), objarray_sz);
}
void
diff --git a/libexec/spamd-setup/spamd-setup.c b/libexec/spamd-setup/spamd-setup.c
index 4efcbc5f223..51041a50816 100644
--- a/libexec/spamd-setup/spamd-setup.c
+++ b/libexec/spamd-setup/spamd-setup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd-setup.c,v 1.32 2007/02/27 02:10:58 beck Exp $ */
+/* $OpenBSD: spamd-setup.c,v 1.33 2007/09/02 15:19:20 deraadt Exp $ */
/*
* Copyright (c) 2003 Bob Beck. All rights reserved.
@@ -311,7 +311,7 @@ open_file(char *method, char *file)
return (i);
} else if (strcmp(method, "exec") == 0) {
len = strlen(file);
- argv = malloc(len * sizeof(char *));
+ argv = calloc(len, sizeof(char *));
if (argv == NULL)
errx(1, "malloc failed");
for (ap = argv; ap < &argv[len - 1] &&
@@ -540,7 +540,7 @@ collapse_blacklist(struct bl *bl, size_t blc)
if (blc == 0)
return (NULL);
- cl = malloc(((blc / 2) + 1) * sizeof(struct cidr));
+ cl = calloc(((blc / 2) + 1), sizeof(struct cidr));
if (cl == NULL) {
return (NULL);
}
diff --git a/libexec/spamd/sdl.c b/libexec/spamd/sdl.c
index d3d08525748..4f88b5133aa 100644
--- a/libexec/spamd/sdl.c
+++ b/libexec/spamd/sdl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdl.c,v 1.16 2007/03/26 16:36:18 beck Exp $ */
+/* $OpenBSD: sdl.c,v 1.17 2007/09/02 15:19:20 deraadt Exp $ */
/*
* Copyright (c) 2003-2007 Bob Beck. All rights reserved.
@@ -99,7 +99,7 @@ sdl_add(char *sdname, char *sdstring, char ** addrs, int addrc)
* formatted v4 and v6 addrs, if they don't all convert correctly, the
* add fails. Each address should be address/maskbits
*/
- blacklists[idx].addrs = malloc(addrc * sizeof(struct sdentry));
+ blacklists[idx].addrs = calloc(addrc, sizeof(struct sdentry));
if (blacklists[idx].addrs == NULL)
goto misc_error;