netutils/ftpd: fix hardfault when initial socket, bind or listen fails
@@ -4496,7 +4496,10 @@ void ftpd_close(FTPD_SESSION handle)
DEBUGASSERT(handle);
server = (struct ftpd_server_s *)handle;
+ if (server->head != NULL)
+ {
ftpd_account_free(server->head);
+ }
if (server->sd >= 0)
{
