Merge branch 'bugfix/esp_tls_coverity_warning' into 'master'

Fix coverity warning in esp-tls component

See merge request espressif/esp-idf!22934
This commit is contained in:
Aditya Patwardhan 2023-03-31 15:22:58 +08:00
commit 7c8e8557a6

View File

@ -331,7 +331,9 @@ static inline esp_err_t tcp_connect(const char *host, int hostlen, int port, con
{
struct sockaddr_storage address;
int fd;
esp_err_t ret = esp_tls_hostname_to_fd(host, hostlen, port, cfg->addr_family, &address, &fd);
esp_tls_addr_family_t addr_family = (cfg != NULL) ? cfg->addr_family : ESP_TLS_AF_UNSPEC;
esp_err_t ret = esp_tls_hostname_to_fd(host, hostlen, port, addr_family, &address, &fd);
if (ret != ESP_OK) {
ESP_INT_EVENT_TRACKER_CAPTURE(error_handle, ESP_TLS_ERR_TYPE_SYSTEM, errno);
return ret;