Skip to content

Commit 0ebe3c2

Browse files
committed
Initialize _ota variables inside begin function
1 parent c793288 commit 0ebe3c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Arduino_ESP32_OTA.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Arduino_ESP32_OTA::Error Arduino_ESP32_OTA::begin()
7676
DEBUG_ERROR("%s: board is not capable to perform OTA", __FUNCTION__);
7777
return Error::NoOtaStorage;
7878
}
79+
80+
/* initialize private variables */
81+
_ota_size = 0;
82+
_ota_header = {0};
7983

8084
if(!Update.begin(UPDATE_SIZE_UNKNOWN)) {
8185
DEBUG_ERROR("%s: failed to initialize flash update", __FUNCTION__);

0 commit comments

Comments
 (0)