esp_http_server: fix few coverity warnings

- unreachable code
- uninitialized values
- missing return checks
This commit is contained in:
Mahavir Jain
2022-10-10 15:12:10 +05:30
parent a7b42be1bd
commit fffc72d307
3 changed files with 14 additions and 7 deletions

View File

@@ -359,7 +359,9 @@ void httpd_sess_delete(struct httpd_data *hd, struct sock_db *session)
.l_onoff = true,
.l_linger = hd->config.linger_timeout,
};
setsockopt(session->fd, SOL_SOCKET, SO_LINGER, &so_linger, sizeof(struct linger));
if (setsockopt(session->fd, SOL_SOCKET, SO_LINGER, &so_linger, sizeof(struct linger)) < 0) {
ESP_LOGW(TAG, LOG_FMT("error enabling SO_LINGER (%d)"), errno);
}
}
// Call close function if defined