Hi Prakash,
Thanks for getting in touch.
I think what you are after is the function: void mbedtls_ssl_free(mbedtls_ssl_context *ssl)
You can find it's implementation in ssl_tls.c.
I hope that helps you out.
Thanks, Tom
On Tue, 2024-02-27 at 20:19 +0530, Satya Prakash Prasad via mbed-tls wrote:
Hi,
We are writing a client code which can accept or decline connection to the server - so for each connection I understand there is a mbedtls_ssl_context data established. Once the same is closed or not required we need to do deinitialize or free memory allocated to its member variables like - we need to free all memory allocated since we need it back else our application will run out of memory like:
os_free(mbed_ctx->handshake); os_free(mbed_ctx->transform_negotiate); os_free(mbed_ctx->session_negotiate); os_free(mbed_ctx->in_buf); os_free(mbed_ctx->out_buf);
But there are many member variables which also need to free memory if allocated and assigned to it.
Is there a function / method that can free all memory for mbedtls_ssl_context instance variable?
Thanks in advance.
Regards, Prakash