summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-03-14 23:00:43 +0000
committermillert <millert@openbsd.org>2015-03-14 23:00:43 +0000
commit2a799a8676d9a20d1c1ee015f203b579af7b2321 (patch)
treec0815eb70de0caddf0fc9427bcb5525d65314add /usr.bin
parentTZ_MAX_CHARS in the old tzfile.h bears no resemblence to the actual (diff)
downloadwireguard-openbsd-2a799a8676d9a20d1c1ee015f203b579af7b2321.tar.xz
wireguard-openbsd-2a799a8676d9a20d1c1ee015f203b579af7b2321.zip
Use xstrdup(), from Michael W. Bombardieri
OK espie@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/m4/gnum4.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/m4/gnum4.c b/usr.bin/m4/gnum4.c
index 4837cf8b14b..99d5255c1a6 100644
--- a/usr.bin/m4/gnum4.c
+++ b/usr.bin/m4/gnum4.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gnum4.c,v 1.47 2015/01/16 06:40:09 deraadt Exp $ */
+/* $OpenBSD: gnum4.c,v 1.48 2015/03/14 23:00:43 millert Exp $ */
/*
* Copyright (c) 1999 Marc Espie
@@ -74,9 +74,7 @@ new_path_entry(const char *dirname)
n = malloc(sizeof(struct path_entry));
if (!n)
errx(1, "out of memory");
- n->name = strdup(dirname);
- if (!n->name)
- errx(1, "out of memory");
+ n->name = xstrdup(dirname);
n->next = 0;
return n;
}
@@ -111,9 +109,7 @@ ensure_m4path()
if (!envpath)
return;
/* for portability: getenv result is read-only */
- envpath = strdup(envpath);
- if (!envpath)
- errx(1, "out of memory");
+ envpath = xstrdup(envpath);
for (sweep = envpath;
(path = strsep(&sweep, ":")) != NULL;)
addtoincludepath(path);