Hi Thomas / All,
Thanks for the info - I was able to add the function as suggested however I see that the structure in concern has a lot of other member variable like as mentioned below and I actually cannot find code reference in mbedtls_ssl_free to free all of them - please confirm if calling mbedtls_ssl_free is enough such that all allocated memory for all variables in mbedtls_ssl_context is released:
..........................................................
mbedtls_ssl_config
mbedtls_ssl_send_t
mbedtls_ssl_recv_t
mbedtls_ssl_recv_timeout_t
p_bio
mbedtls_ssl_session *session_in; /*!< current session data (in) */
mbedtls_ssl_session *session_out; /*!< current session data (out) */
mbedtls_ssl_session *session; /*!< negotiated session data */
mbedtls_ssl_session *session_negotiate; /*!< session data in negotiation */
mbedtls_ssl_handshake_params *handshake; /*!< params required only during
the handshake process */
mbedtls_ssl_transform *transform_in; /*!< current transform params (in) */
mbedtls_ssl_transform *transform_out; /*!< current transform params (in) */
mbedtls_ssl_transform *transform; /*!< negotiated transform params */
mbedtls_ssl_transform *transform_negotiate; /*!< transform params in negotiation */
unsigned char *in_buf; /*!< input buffer */
unsigned char *in_ctr; /*!< 64-bit incoming message counter
TLS: maintained by us
DTLS: read from peer */
unsigned char *in_hdr; /*!< start of record header */
unsigned char *in_len; /*!< two-bytes message length field */
unsigned char *in_iv; /*!< ivlen-byte IV */
unsigned char *in_msg; /*!< message contents (in_iv+ivlen) */
unsigned char *in_offt; /*!< read offset in application data */
..........................................................................................
Regards,
Prakash