Browse Source

Save original value returned by getifaddrs to free later; ok henning@

OPENBSD_3_7
dtucker 20 years ago
parent
commit
621223eef3
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/usr.sbin/ntpd/server.c

+ 5
- 5
src/usr.sbin/ntpd/server.c View File

@ -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) {


Loading…
Cancel
Save