mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_socket_leak' into 'master'
esp-tls: socket will be set to -1 and will not be closed Closes IDFGH-8378 See merge request espressif/esp-idf!20333
This commit is contained in:
commit
a9f15d1556
@ -270,8 +270,11 @@ void esp_mbedtls_conn_delete(esp_tls_t *tls)
|
||||
if (tls != NULL) {
|
||||
esp_mbedtls_cleanup(tls);
|
||||
if (tls->is_tls) {
|
||||
if (tls->server_fd.fd != -1) {
|
||||
mbedtls_net_free(&tls->server_fd);
|
||||
tls->sockfd = tls->server_fd.fd;
|
||||
/* Socket is already closed by `mbedtls_net_free` and hence also change assignment of its copy to an invalid value */
|
||||
tls->sockfd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user