From 1f75c13ee00d37b5b2e658404e7d2f3338991d3a Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Mon, 11 Nov 2002 07:31:48 +0000 Subject: [PATCH] Don't free the current addrinfo list, or else a pointer to a freed memory area would arise. Only an addrinfo list from an earlier call to getaddrinfo() should be freed there because it will be substituted by the current list referenced by "res". Reported by: John Long MFC after: 5 days --- libexec/ftpd/ftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 05d41889500..d64bce4deee 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 */ }