Skip to content

Commit 7defa12

Browse files
committed
Remove address from whitelist if the procedure fails.
This prevents a situation where the whitelist contains the address but the procedure errors and the address cannot be added again.
1 parent 479af4a commit 7defa12

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/NimBLEDevice.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ bool NimBLEDevice::whiteListAdd(const NimBLEAddress & address) {
678678
int rc = ble_gap_wl_set(&wlVec[0], wlVec.size());
679679
if (rc != 0) {
680680
NIMBLE_LOGE(LOG_TAG, "Failed adding to whitelist rc=%d", rc);
681+
m_whiteList.pop_back();
681682
return false;
682683
}
683684

0 commit comments

Comments
 (0)