diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-16 06:33:04 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-16 06:33:04 +0000 |
commit | 032e0f8413fd0127549faa5b5c280db1b9143554 (patch) | |
tree | f59cf869b53fd16779d0705c2b6d347b778a7b13 /usr.sbin | |
parent | 74fb935fb670b9592ea5ab6ea25b1980205945c3 (diff) |
check strdup ret val.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 3 |
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); |