Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions firmware_espidf/lib/UpdateManager/UpdateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ esp_err_t UpdateManager::_update_firmware_ota() {
ret = esp_https_ota_get_img_desc(https_ota_handle, &app_desc);
if (ret != ESP_OK) {
ESP_LOGE("UpdateManager", "esp_https_ota_get_img_desc failed");
esp_https_ota_abort(https_ota_handle);
return ESP_ERR_NOT_FINISHED;
}

Expand Down Expand Up @@ -657,6 +658,8 @@ esp_err_t UpdateManager::_update_firmware_ota() {
return ESP_ERR_NOT_FINISHED;
}
} else {
// esp_https_ota_finish frees the handle on its own; on this path it must be released explicitly.
esp_https_ota_abort(https_ota_handle);
esp_event_post(UPDATEMANAGER_EVENT, updatemanager_event_t::FIRMWARE_UPDATE_FINISHED, NULL, 0, pdMS_TO_TICKS(500));
ESP_LOGI("UpdateManager", "Firmware OTA update failed: %s", esp_err_to_name(ret));
return ESP_ERR_NOT_FINISHED;
Expand Down