Skip to content

Commit

Permalink
fix AsyncClient::connect memory leak
Browse files Browse the repository at this point in the history
[pull request 138](me-no-dev#138)
  • Loading branch information
serek4 committed Feb 5, 2024
1 parent 27ec431 commit 5b8a4ae
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 @@ -264,6 +264,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 5b8a4ae

Please sign in to comment.