Skip to content

Commit 9c51acf

Browse files
committed
Initialize _ota variables inside begin function
1 parent e88ff43 commit 9c51acf

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
@@ -71,6 +71,10 @@ Arduino_ESP32_OTA::Error Arduino_ESP32_OTA::begin()
7171

7272
/* ... initialize CRC ... */
7373
_crc32 = 0xFFFFFFFF;
74+
75+
/* initialize private variables */
76+
_ota_size = 0;
77+
_ota_header = {0};
7478

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

0 commit comments

Comments
 (0)