diff options
author | shin <shin@FreeBSD.org> | 2000-02-03 09:59:36 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-02-03 09:59:36 +0000 |
commit | f7d03af6d56ca6ed1aba73185b3d227ea189ed39 (patch) | |
tree | dc9994524f5d741536f6691264f22ea7e777bf7a /libexec | |
parent | b7aacf578ef00562a5b1d6283329bb0cdffeca1d (diff) | |
download | FreeBSD-src-f7d03af6d56ca6ed1aba73185b3d227ea189ed39.zip FreeBSD-src-f7d03af6d56ca6ed1aba73185b3d227ea189ed39.tar.gz |
Fix ftpd core dump when hostname is not set.
When hostname is not set, ftpd core dumps, because there is no
NULL check for freeing name resolving information for its own
hostname.
So the check is added.
Approved by: jkh
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index cd72ed2..02f89b2 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -642,7 +642,8 @@ inithosts() hrp->anonuser = "ftp"; hrp->next = NULL; thishost = firsthost = lhrp = hrp; - freeaddrinfo(res); + if (res) + freeaddrinfo(res); if ((fp = fopen(_PATH_FTPHOSTS, "r")) != NULL) { int addrsize, error; void *addr; |