Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/traceroute src/usr.sbin/traceroute/traceroute....



details:   https://anonhg.NetBSD.org/src/rev/bc06d1888a41
branches:  netbsd-1-5
changeset: 489602:bc06d1888a41
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sat Sep 30 14:24:46 2000 +0000

description:
src/usr.sbin/traceroute/traceroute.c            1.40

Avoid calling savestr() to create a string which will later be passed
to free()

Pull up approved by jhawk.

diffstat:

 usr.sbin/traceroute/traceroute.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e4ed077ae15c -r bc06d1888a41 usr.sbin/traceroute/traceroute.c
--- a/usr.sbin/traceroute/traceroute.c  Sat Sep 30 14:07:53 2000 +0000
+++ b/usr.sbin/traceroute/traceroute.c  Sat Sep 30 14:24:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traceroute.c,v 1.39 2000/01/31 14:26:40 itojun Exp $   */
+/*     $NetBSD: traceroute.c,v 1.39.4.1 2000/09/30 14:24:46 sommerfeld Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997
@@ -29,7 +29,7 @@
 #else
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997\n\
 The Regents of the University of California.  All rights reserved.\n");
-__RCSID("$NetBSD: traceroute.c,v 1.39 2000/01/31 14:26:40 itojun Exp $");
+__RCSID("$NetBSD: traceroute.c,v 1.39.4.1 2000/09/30 14:24:46 sommerfeld Exp $");
 #endif
 #endif
 
@@ -1446,7 +1446,7 @@
                exit(1);
        }
        if (inet_aton(hostname, &addr) != 0) {
-               hi->name = savestr(hostname);
+               hi->name = strdup(hostname);
                hi->n = 1;
                hi->addrs = calloc(1, sizeof(hi->addrs[0]));
                if (hi->addrs == NULL) {
@@ -1467,7 +1467,7 @@
                Fprintf(stderr, "%s: bad host %s\n", prog, hostname);
                exit(1);
        }
-       hi->name = savestr(hp->h_name);
+       hi->name = strdup(hp->h_name);
        for (n = 0, p = hp->h_addr_list; *p != NULL; ++n, ++p)
                continue;
        hi->n = n;



Home | Main Index | Thread Index | Old Index