summaryrefslogtreecommitdiffstats
path: root/usr.bin/xargs
diff options
context:
space:
mode:
authoruqs <uqs@FreeBSD.org>2015-12-29 11:24:41 +0000
committeruqs <uqs@FreeBSD.org>2015-12-29 11:24:41 +0000
commit11e0dd6c90098a31b4ee84a2af39114001952d67 (patch)
treeb886de70650826ff015bc0343d808ffba0f524fd /usr.bin/xargs
parentd4f2c120c09150a7012ceea91a74ea068aa5a9c6 (diff)
downloadFreeBSD-src-11e0dd6c90098a31b4ee84a2af39114001952d67.zip
FreeBSD-src-11e0dd6c90098a31b4ee84a2af39114001952d67.tar.gz
Fix type mismatches for malloc(3) and Co.
This is rather pedantic, as for most architectures it holds that sizeof(type *) == sizeof(type **) Found by: clang static analyzer Reviewed by: ed Differential Revision: https://reviews.freebsd.org/D4722
Diffstat (limited to 'usr.bin/xargs')
-rw-r--r--usr.bin/xargs/xargs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index c56ab60..955711c 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -234,7 +234,7 @@ main(int argc, char *argv[])
* NULL.
*/
linelen = 1 + argc + nargs + 1;
- if ((av = bxp = malloc(linelen * sizeof(char **))) == NULL)
+ if ((av = bxp = malloc(linelen * sizeof(char *))) == NULL)
errx(1, "malloc failed");
/*
@@ -471,7 +471,7 @@ prerun(int argc, char *argv[])
* Allocate memory to hold the argument list, and
* a NULL at the tail.
*/
- tmp = malloc((argc + 1) * sizeof(char**));
+ tmp = malloc((argc + 1) * sizeof(char *));
if (tmp == NULL) {
warnx("malloc failed");
xexit(*argv, 1);
OpenPOWER on IntegriCloud