diff options
author | ache <ache@FreeBSD.org> | 1996-01-19 03:18:50 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-01-19 03:18:50 +0000 |
commit | 6755beedbf0ddaa9e66e91c8e74f620ede6bfad5 (patch) | |
tree | 310efae78c1cc6a1181d4c54a2bea7fc2dd796d1 /usr.sbin/traceroute | |
parent | 61b348c119a4137e3e7927cb6ec1485cb2088535 (diff) | |
download | FreeBSD-src-6755beedbf0ddaa9e66e91c8e74f620ede6bfad5.zip FreeBSD-src-6755beedbf0ddaa9e66e91c8e74f620ede6bfad5.tar.gz |
Hostname points to static area which overrides with each gethost*
call, strdup() it.
Diffstat (limited to 'usr.sbin/traceroute')
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index bd9d250..5c18e38 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -393,7 +393,7 @@ main(argc, argv) if (hp) { to->sin_family = hp->h_addrtype; bcopy(hp->h_addr, (caddr_t)&to->sin_addr, hp->h_length); - hostname = hp->h_name; + hostname = strdup(hp->h_name); } else { (void)fprintf(stderr, "traceroute: unknown host %s\n", *argv); |