summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2018-06-12 15:24:31 +0000
committermillert <millert@openbsd.org>2018-06-12 15:24:31 +0000
commitb59d868931be399ae114c244c22f073e3ce0cdd4 (patch)
tree471d501680af9f424515a4a62b4630566385d4a0
parentDon't panic on I/O to unregistered regionspaces. Needed to unbreak the GPD (diff)
downloadwireguard-openbsd-b59d868931be399ae114c244c22f073e3ce0cdd4.tar.xz
wireguard-openbsd-b59d868931be399ae114c244c22f073e3ce0cdd4.zip
Use sizeof(char *) not sizeof(char **) when allocating an array
of strings with calloc(3). From David CARLIER. OK tb@
-rw-r--r--usr.bin/xargs/xargs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index 0ab4d16a739..ce1533e7016 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xargs.c,v 1.33 2017/10/16 13:10:50 anton Exp $ */
+/* $OpenBSD: xargs.c,v 1.34 2018/06/12 15:24:31 millert Exp $ */
/* $FreeBSD: xargs.c,v 1.51 2003/05/03 19:09:11 obrien Exp $ */
/*-
@@ -198,7 +198,7 @@ main(int argc, char *argv[])
* NULL.
*/
linelen = 1 + argc + nargs + 1;
- if ((av = bxp = calloc(linelen, sizeof(char **))) == NULL)
+ if ((av = bxp = calloc(linelen, sizeof(char *))) == NULL)
err(1, NULL);
/*
@@ -438,7 +438,7 @@ prerun(int argc, char *argv[])
* Allocate memory to hold the argument list, and
* a NULL at the tail.
*/
- tmp = calloc(argc + 1, sizeof(char**));
+ tmp = calloc(argc + 1, sizeof(char *));
if (tmp == NULL)
err(1, NULL);
tmp2 = tmp;