diff options
author | yar <yar@FreeBSD.org> | 2002-11-11 07:31:48 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2002-11-11 07:31:48 +0000 |
commit | e2616c6490bb0ea16984d873449ac5b257281d0d (patch) | |
tree | b604295adce277e1f0602c3b16b8007aeb4183db /libexec/ftpd/ftpd.c | |
parent | 78766a7b7aa74fa44d582aa014484403872cb079 (diff) | |
download | FreeBSD-src-e2616c6490bb0ea16984d873449ac5b257281d0d.zip FreeBSD-src-e2616c6490bb0ea16984d873449ac5b257281d0d.tar.gz |
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 <fbsd1@pruam.com>
MFC after: 5 days
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r-- | libexec/ftpd/ftpd.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 */ } |