Page MenuHomeFreeBSD

D41040.1775843585.diff
No OneTemporary

Size
751 B
Referenced Files
None
Subscribers
None

D41040.1775843585.diff

diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -258,8 +258,8 @@
* NULL.
*/
linelen = 1 + argc + (size_t)nargs + 1;
- if ((av = bxp = malloc(linelen * sizeof(char *))) == NULL)
- errx(1, "malloc failed");
+ if ((av = bxp = calloc(linelen, sizeof(char *))) == NULL)
+ errx(1, "calloc failed");
/*
* Use the user's name for the utility as argv[0], just like the
@@ -499,9 +499,9 @@
* Allocate memory to hold the argument list, and
* a NULL at the tail.
*/
- tmp = malloc((argc + 1) * sizeof(char *));
+ tmp = calloc(argc + 1, sizeof(char *));
if (tmp == NULL) {
- warnx("malloc failed");
+ warnx("calloc failed");
xexit(*argv, 1);
}
tmp2 = tmp;

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 10, 5:53 PM (9 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28318081
Default Alt Text
D41040.1775843585.diff (751 B)

Event Timeline