diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-03-14 23:00:44 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-03-14 23:00:44 +0000 |
commit | 0497b3ae0e6a20d1c5ae5f84a72a91a1ee3b625d (patch) | |
tree | 61a153c3e685607540d0de83177ecad5355b7fa3 /usr.bin/m4 | |
parent | 1071f7fad90e8b8b62ac8478bfccb288eb047a10 (diff) |
Use xstrdup(), from Michael W. Bombardieri
OK espie@
Diffstat (limited to 'usr.bin/m4')
-rw-r--r-- | usr.bin/m4/gnum4.c | 10 |
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); |