diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-12-22 05:36:12 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-12-22 05:36:12 +0000 |
commit | a093f9af35c6d10ba9b31a30fbfcbcb279b8f2a1 (patch) | |
tree | 8b20ab88597d6b5eee64ef7b3a72e403c434ef2b | |
parent | f74243947e96f441de7b10dbd803c27a4f857abd (diff) |
Save original value returned by getifaddrs to free later; ok henning@
-rw-r--r-- | usr.sbin/ntpd/server.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c index 6165f756c6e..2a88d9c2a85 100644 --- a/usr.sbin/ntpd/server.c +++ b/usr.sbin/ntpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.19 2004/12/08 15:47:38 mickey Exp $ */ +/* $OpenBSD: server.c,v 1.20 2004/12/22 05:36:11 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -32,16 +32,16 @@ int setup_listeners(struct servent *se, struct ntpd_conf *conf, u_int *cnt) { struct listen_addr *la; - struct ifaddrs *ifap; + struct ifaddrs *ifa, *ifap; struct sockaddr *sa; u_int new_cnt = 0; int tos = IPTOS_LOWDELAY; if (conf->listen_all) { - if (getifaddrs(&ifap) == -1) + if (getifaddrs(&ifa) == -1) fatal("getifaddrs"); - for (; ifap != NULL; ifap = ifap->ifa_next) { + for (ifap = ifa; ifap != NULL; ifap = ifap->ifa_next) { sa = ifap->ifa_addr; if (sa->sa_family != AF_INET && @@ -56,7 +56,7 @@ setup_listeners(struct servent *se, struct ntpd_conf *conf, u_int *cnt) TAILQ_INSERT_TAIL(&conf->listen_addrs, la, entry); } - freeifaddrs(ifap); + freeifaddrs(ifa); } TAILQ_FOREACH(la, &conf->listen_addrs, entry) { |