mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(esp_http_server): fix GCC 14 analyzer warnings
This commit is contained in:
parent
725b9ec81e
commit
a262e879d1
@ -146,11 +146,13 @@ esp_err_t httpd_register_uri_handler(httpd_handle_t handle,
|
||||
|
||||
for (int i = 0; i < hd->config.max_uri_handlers; i++) {
|
||||
if (hd->hd_calls[i] == NULL) {
|
||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak") // False-positive detection. TODO GCC-366
|
||||
hd->hd_calls[i] = malloc(sizeof(httpd_uri_t));
|
||||
if (hd->hd_calls[i] == NULL) {
|
||||
/* Failed to allocate memory */
|
||||
return ESP_ERR_HTTPD_ALLOC_MEM;
|
||||
}
|
||||
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
|
||||
|
||||
/* Copy URI string */
|
||||
hd->hd_calls[i]->uri = strdup(uri_handler->uri);
|
||||
|
Loading…
Reference in New Issue
Block a user