diff --git a/components/esp_http_server/src/httpd_uri.c b/components/esp_http_server/src/httpd_uri.c index 5a871902ca..5746febc74 100644 --- a/components/esp_http_server/src/httpd_uri.c +++ b/components/esp_http_server/src/httpd_uri.c @@ -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);