mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Fix2115 (#2244)
* Update ESP8266WiFiMulti.cpp Fix #2115 * Update ESP8266WiFiMulti.cpp Fix #2115. Cleaner version (catch strdup("") fail).
This commit is contained in:
parent
f8a8a2a359
commit
86067333f5
@ -184,14 +184,17 @@ bool ESP8266WiFiMulti::APlistAdd(const char* ssid, const char *passphrase) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(passphrase && *passphrase != 0x00) {
|
if(passphrase) {
|
||||||
newAP.passphrase = strdup(passphrase);
|
newAP.passphrase = strdup(passphrase);
|
||||||
|
} else {
|
||||||
|
newAP.passphrase = strdup("");
|
||||||
|
}
|
||||||
|
|
||||||
if(!newAP.passphrase) {
|
if(!newAP.passphrase) {
|
||||||
DEBUG_WIFI_MULTI("[WIFI][APlistAdd] fail newAP.passphrase == 0\n");
|
DEBUG_WIFI_MULTI("[WIFI][APlistAdd] fail newAP.passphrase == 0\n");
|
||||||
free(newAP.ssid);
|
free(newAP.ssid);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
APlist.push_back(newAP);
|
APlist.push_back(newAP);
|
||||||
DEBUG_WIFI_MULTI("[WIFI][APlistAdd] add SSID: %s\n", newAP.ssid);
|
DEBUG_WIFI_MULTI("[WIFI][APlistAdd] add SSID: %s\n", newAP.ssid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user