summaryrefslogtreecommitdiffstats
path: root/bin/csh/csh.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-10-16 19:43:31 +0000
committerderaadt <deraadt@openbsd.org>2014-10-16 19:43:31 +0000
commita8627d2c40d5ed23e746aca6d869ba89c5df59e7 (patch)
tree9eef843c1894b7a53cd101ef566a6ed1733f6d5d /bin/csh/csh.c
parentAdditonal registers needs to be saved in sc_save2, not sc_save. (diff)
downloadwireguard-openbsd-a8627d2c40d5ed23e746aca6d869ba89c5df59e7.tar.xz
wireguard-openbsd-a8627d2c40d5ed23e746aca6d869ba89c5df59e7.zip
Use reallocarray() and remove a few archaic memory allocation practices.
ok deraadt
Diffstat (limited to 'bin/csh/csh.c')
-rw-r--r--bin/csh/csh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index 9c9d7dac2be..fb908d3f9d8 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: csh.c,v 1.25 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: csh.c,v 1.26 2014/10/16 19:43:31 deraadt Exp $ */
/* $NetBSD: csh.c,v 1.14 1995/04/29 23:21:28 mycroft Exp $ */
/*-
@@ -1288,7 +1288,7 @@ defaultpath(void)
Char **blk, **blkp;
struct stat stb;
- blkp = blk = (Char **) xmalloc((size_t) sizeof(Char *) * 10);
+ blkp = blk = xreallocarray(NULL, 10, sizeof(Char *));
#define DIRAPPEND(a) \
if (stat(ptr = a, &stb) == 0 && S_ISDIR(stb.st_mode)) \