fix(esp_https_ota): fixed missing return check during setting range header

This commit added return value check during setting the range header
for partial download procedure of esp_https_ota
This commit is contained in:
nilesh.kale
2025-08-12 10:26:14 +05:30
parent 5df7a0a8c9
commit cc95457c22

View File

@@ -367,6 +367,11 @@ esp_err_t esp_https_ota_begin(const esp_https_ota_config_t *ota_config, esp_http
) {
char *header_val = NULL;
asprintf(&header_val, "bytes=%d-", https_ota_handle->binary_file_len);
if (header_val == NULL) {
ESP_LOGE(TAG, "Failed to allocate memory for HTTP header");
err = ESP_ERR_NO_MEM;
goto http_cleanup;
}
esp_http_client_set_header(https_ota_handle->http_client, "Range", header_val);
free(header_val);
}