[cli] set mUseTls to false after de-initializing TCP session (#10977)

Avoid SSL context operations in TCP callbacks (for
eg. `HandleTcpDisconnected`) when the context could have already been
de-allocated after de-initialization.
This commit is contained in:
Suvesh Pratapa
2024-11-27 15:36:33 -08:00
committed by GitHub
parent 64cf63ecb2
commit ae5b750d30
+2
View File
@@ -304,6 +304,8 @@ template <> otError TcpExample::Process<Cmd("deinit")>(Arg aArgs[])
mbedtls_pk_free(&mPKey);
mbedtls_x509_crt_free(&mSrvCert);
mUseTls = false;
}
#endif