Skip to content

Commit

Permalink
fix AsyncClient::connect memory leak me-no-dev#138
Browse files Browse the repository at this point in the history
  • Loading branch information
timhawes committed Dec 27, 2023
1 parent cd3d827 commit 1e3848f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ESPAsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ bool AsyncClient::connect(IPAddress ip, uint16_t port){
tcp_arg(pcb, this);
tcp_err(pcb, &_s_error);
size_t err = tcp_connect(pcb, &addr, port,(tcp_connected_fn)&_s_connected);
if (err != ERR_OK){
tcp_close(pcb);
}
return (ERR_OK == err);
}

Expand Down

0 comments on commit 1e3848f

Please sign in to comment.