mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
esp-tls: Allow esp_tls_conn_delete() to be called with a NULL pointer
This commit is contained in:
parent
fe907bde60
commit
507ca8196c
@ -230,11 +230,13 @@ exit:
|
||||
*/
|
||||
void esp_tls_conn_delete(esp_tls_t *tls)
|
||||
{
|
||||
mbedtls_cleanup(tls);
|
||||
if (tls->sockfd) {
|
||||
close(tls->sockfd);
|
||||
if (tls != NULL) {
|
||||
mbedtls_cleanup(tls);
|
||||
if (tls->sockfd) {
|
||||
close(tls->sockfd);
|
||||
}
|
||||
free(tls);
|
||||
}
|
||||
free(tls);
|
||||
};
|
||||
|
||||
static ssize_t tcp_write(esp_tls_t *tls, const char *data, size_t datalen)
|
||||
|
Loading…
x
Reference in New Issue
Block a user