Skip to content

Conversation

@jar-in
Copy link

@jar-in jar-in commented Feb 21, 2020

I have found that there is a memory leak in the secure part of the AsyncClient.
The problem can be seen simply when you create new AsyncClient by new, then connect to some secure server and then try to dealocate by delete. This will left about 40kB of memory somewhere.
This patch may solve it. Hope it helps.

There is a memory leak in the AsyncClient. The SSL part is not freed by the destructor. My opinion is that it is caused by _lwip_fin where we have
_pcb = NULL;
but when we want to delete ssl part by int tcp_ssl_free(struct tcp_pcb *tcp) 
it takes +pcb as an argument but it is NULL... I think this as the simplest solution.
@jar-in
Copy link
Author

jar-in commented Feb 21, 2020

The SSL part is not freed by the destructor when _pcb is NULL.
There is the statement
_pcb = NULL;
in function _lwip_fin but when we want to delete ssl part by int tcp_ssl_free(struct tcp_pcb *tcp)
it takes _pcb as an argument but it is NULL...

@jar-in
Copy link
Author

jar-in commented Feb 21, 2020

There is also possibility to remove the old version of tcp_ssl_free at all and use modified version with argument this instead of _pcb everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant