netutils/ftpd: fix hardfault when initial socket, bind or listen fails

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
This commit is contained in:
Juha Niskanen 2021-01-13 19:55:48 +02:00 committed by Xiang Xiao
parent 6aca60133c
commit 5c8d6934a5

View File

@ -4496,7 +4496,10 @@ void ftpd_close(FTPD_SESSION handle)
DEBUGASSERT(handle);
server = (struct ftpd_server_s *)handle;
ftpd_account_free(server->head);
if (server->head != NULL)
{
ftpd_account_free(server->head);
}
if (server->sd >= 0)
{