Merge branch 'fix/handle_return_during_assiging_header_for_range_request_v5.5' into 'release/v5.5'

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

See merge request espressif/esp-idf!41193
This commit is contained in:
Mahavir Jain
2025-09-02 09:12:12 +05:30

View File

@@ -359,6 +359,11 @@ esp_err_t esp_https_ota_begin(const esp_https_ota_config_t *ota_config, esp_http
if (https_ota_handle->binary_file_len > 0 && !https_ota_handle->partial_http_download) {
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);
}