Closed jeremyB01 closed 9 months ago
Hi @jeremyB01 You probably right.
void EthernetClient::stop()
{
if (_tcp_client == NULL) {
return;
}
// close tcp connection if not closed yet
if (status() != TCP_CLOSING) {
tcp_connection_close(_tcp_client->pcb, _tcp_client);
}
+ mem_free(_tcp_client);
}
Could you submit a PR and test? Thanks in advance.
Created PR. The bug seems to be resolved. Thanks a lot.
In the
EthernetClient::connect(IPAddress ip, uint16_t port)
function there is memory allocated for the_tcp_client
variable. In theEthernetClient::stop()
the allocated memory is not freed up. Am I missing some part where allocated memory is freed up after usage or does this have an other specific reason? I stumbled over that issue by trying to keep me footprint as small as possible and only generating a EthernetClient object if needed and closing it afterwards.