mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
esp-tls: Allow esp_tls_conn_delete() to be called with a NULL pointer
This commit is contained in:
committed by
Angus Gratton
parent
fe907bde60
commit
507ca8196c
@@ -230,11 +230,13 @@ exit:
|
|||||||
*/
|
*/
|
||||||
void esp_tls_conn_delete(esp_tls_t *tls)
|
void esp_tls_conn_delete(esp_tls_t *tls)
|
||||||
{
|
{
|
||||||
mbedtls_cleanup(tls);
|
if (tls != NULL) {
|
||||||
if (tls->sockfd) {
|
mbedtls_cleanup(tls);
|
||||||
close(tls->sockfd);
|
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)
|
static ssize_t tcp_write(esp_tls_t *tls, const char *data, size_t datalen)
|
||||||
|
Reference in New Issue
Block a user