From a4715496629f6355e281dad1262f3e833e9b502e Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sat, 14 Mar 2026 21:07:45 +0300 Subject: [PATCH] perf: updated error checks --- zh_ota_server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zh_ota_server.c b/zh_ota_server.c index 1e99271..c5a461d 100644 --- a/zh_ota_server.c +++ b/zh_ota_server.c @@ -41,6 +41,7 @@ esp_err_t zh_ota_server_init(httpd_handle_t server, const char *path) ZH_LOGI("OTA server initialization started."); ZH_ERROR_CHECK(server != NULL && path != NULL, ESP_ERR_INVALID_ARG, NULL, "OTA server initialization failed. Invalid argument."); _ota_path = (char *)heap_caps_calloc(1, strlen(path), MALLOC_CAP_8BIT); + ZH_ERROR_CHECK(_ota_path != NULL, ESP_ERR_NO_MEM, NULL, "OTA server initialization failed. Memory allocation fail or no free memory in the heap."); strcpy(_ota_path, path); _ota_page.uri = _ota_path; _ota_page_ws.uri = _ota_ws_path;