summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-10-16 06:33:04 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-10-16 06:33:04 +0000
commit032e0f8413fd0127549faa5b5c280db1b9143554 (patch)
treef59cf869b53fd16779d0705c2b6d347b778a7b13 /usr.sbin
parent74fb935fb670b9592ea5ab6ea25b1980205945c3 (diff)
check strdup ret val.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/traceroute/traceroute.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c
index 5a6f0b88bc4..ecf84ceb187 100644
--- a/usr.sbin/traceroute/traceroute.c
+++ b/usr.sbin/traceroute/traceroute.c
@@ -400,7 +400,8 @@ main(argc, argv)
errx(1, "unknown host %s", *argv);
to.sin_family = hp->h_addrtype;
memcpy(&to.sin_addr, hp->h_addr, hp->h_length);
- hostname = strdup(hp->h_name);
+ if ((hostname = strdup(hp->h_name)) == NULL)
+ err(1, "malloc");
}
if (*++argv)
datalen = atoi(*argv);