Skip to content

Commit e372457

Browse files
committed
Merge remote-tracking branch 'remotes/esp8266/master'
2 parents ac143b4 + 1ac18e1 commit e372457

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ void setup() {
3030
Serial.println("Start");
3131
});
3232
ArduinoOTA.onEnd([]() {
33-
Serial.println("End");
33+
Serial.println("\nEnd");
3434
});
3535
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
36-
Serial.printf("Progress: %u%%\n", (progress / (total / 100)));
36+
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
3737
});
3838
ArduinoOTA.onError([](ota_error_t error) {
3939
Serial.printf("Error[%u]: ", error);

libraries/ESP8266WebServer/src/ESP8266WebServer.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,25 @@ bool ESP8266WebServer::authenticate(const char * username, const char * password
8787
authReq.trim();
8888
char toencodeLen = strlen(username)+strlen(password)+1;
8989
char *toencode = new char[toencodeLen];
90-
if(toencode == NULL)
90+
if(toencode == NULL){
91+
authReq = String();
9192
return false;
93+
}
9294
char *encoded = new char[base64_encode_expected_len(toencodeLen)+1];
93-
if(encoded == NULL)
95+
if(encoded == NULL){
96+
authReq = String();
97+
delete[] toencode;
9498
return false;
95-
99+
}
96100
sprintf(toencode, "%s:%s", username, password);
97101
if(base64_encode_chars(toencode, toencodeLen, encoded) > 0 && authReq.equals(encoded)){
98102
authReq = String();
103+
delete[] toencode;
104+
delete[] encoded;
99105
return true;
100106
}
107+
delete[] toencode;
108+
delete[] encoded;
101109
}
102110
authReq = String();
103111
}

0 commit comments

Comments
 (0)