diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 05d418895007..d64bce4deee4 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -785,7 +785,7 @@ inithosts(void) hrp->hostname = NULL; insert = 1; } else { - if (hrp->hostinfo) + if (hrp->hostinfo && hrp->hostinfo != res) freeaddrinfo(hrp->hostinfo); insert = 0; /* host already in the chain */ }