Skip to content

Commit

Permalink
[cli] Set mUseTls to false after de-initializing TCP session.
Browse files Browse the repository at this point in the history
Avoid SSL context operations in TCP callbacks (for eg. `HandleTcpDisconnected`)
when the context could have already been de-allocated after de-initialization
  • Loading branch information
suveshpratapa committed Nov 27, 2024
1 parent 65dd8bf commit abdc817
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cli/cli_tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ template <> otError TcpExample::Process<Cmd("deinit")>(Arg aArgs[])

mbedtls_pk_free(&mPKey);
mbedtls_x509_crt_free(&mSrvCert);

mUseTls = false;
}
#endif

Expand Down

0 comments on commit abdc817

Please sign in to comment.