Skip to content

Commit

Permalink
Free resources
Browse files Browse the repository at this point in the history
  • Loading branch information
lealem47 committed Jul 15, 2024
1 parent b0cf4cf commit 5ea74bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/wolfsshd/wolfsshd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,8 @@ static int StartSSHD(int argc, char** argv)
== SOCKET_ERROR) {
WLOG(WS_LOG_DEBUG, "wolfSSH non-fatal error: "
"ioctlsocket failed");
WCLOSESOCKET(conn->fd);
WFREE(conn, NULL, DYNTYPE_SSHD);
continue;
}
#elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET) \
Expand All @@ -2427,12 +2429,16 @@ static int StartSSHD(int argc, char** argv)
if (flags < 0) {
WLOG(WS_LOG_DEBUG, "wolfSSH non-fatal error: "
"fcntl get failed");
WCLOSESOCKET(conn->fd);
WFREE(conn, NULL, DYNTYPE_SSHD);
continue;
}
flags = fcntl(conn->fd, F_SETFL, flags | O_NONBLOCK);
if (flags < 0) {
WLOG(WS_LOG_DEBUG, "wolfSSH non-fatal error: "
"fcntl set failed");
WCLOSESOCKET(conn->fd);
WFREE(conn, NULL, DYNTYPE_SSHD);
continue;
}
#endif
Expand Down

0 comments on commit 5ea74bc

Please sign in to comment.