summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-03-14 23:00:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-03-14 23:00:44 +0000
commit0497b3ae0e6a20d1c5ae5f84a72a91a1ee3b625d (patch)
tree61a153c3e685607540d0de83177ecad5355b7fa3 /usr.bin
parent1071f7fad90e8b8b62ac8478bfccb288eb047a10 (diff)
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);