From 4bf63f12c39e87fb41395d2c0c8da6d1a6e3cece Mon Sep 17 00:00:00 2001 From: Pascal Speck Date: Mon, 21 Nov 2016 17:08:55 +0100 Subject: [PATCH] Fixed bug that didn't free ftpd ressources on exit --- netutils/ftpd/ftpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netutils/ftpd/ftpd.c b/netutils/ftpd/ftpd.c index 8ff028a6f..5b29b368c 100644 --- a/netutils/ftpd/ftpd.c +++ b/netutils/ftpd/ftpd.c @@ -3954,7 +3954,7 @@ static void ftpd_freesession(FAR struct ftpd_session_s *session) free(session->user); } - if (session->fd < 0) + if (session->fd > 0) { close(session->fd); } @@ -3971,7 +3971,7 @@ static void ftpd_freesession(FAR struct ftpd_session_s *session) free(session->cmd.buffer); } - if (session->cmd.sd <0) + if (session->cmd.sd > 0) { close(session->cmd.sd); }