From e2616c6490bb0ea16984d873449ac5b257281d0d Mon Sep 17 00:00:00 2001 From: yar Date: Mon, 11 Nov 2002 07:31:48 +0000 Subject: 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 05d4188..d64bce4 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 */ } -- cgit v1.1