We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afcbdfc commit c2bbc94Copy full SHA for c2bbc94
features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp
@@ -48,13 +48,20 @@ ble_error_t GenericSecurityManager::init(
48
return err;
49
}
50
51
+ if (_db) {
52
+ delete _db;
53
+ }
54
+
55
+ FILE* db_file = FileSecurityDb::open_db_file(db_path);
56
57
+ if (db_file) {
58
+ _db = new (std::nothrow) FileSecurityDb(db_file);
59
+ } else {
60
+ _db = new (std::nothrow) MemorySecurityDb();
61
62
63
if (!_db) {
- FILE* db_file = FileSecurityDb::open_db_file(db_path);
- if (db_file) {
- _db = new (std::nothrow) FileSecurityDb(db_file);
- } else {
- _db = new (std::nothrow) MemorySecurityDb();
- }
64
+ return BLE_ERROR_NO_MEM;
65
66
67
_db->restore();
0 commit comments