diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-03-18 17:16:04 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-03-18 17:16:04 +0000 |
commit | 254018800ee310d7b8eb3e17f1aea8e411fc7b28 (patch) | |
tree | 34125532a877b167c3fdfdb01386261df135bcd9 /plugins/Dbx_mdb | |
parent | 6a6db513258224651c8e12c43545d368c7456bbc (diff) |
dbx_lmdb: potentiual crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@16503 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb')
-rw-r--r-- | plugins/Dbx_mdb/src/dbcontacts.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp index 442e499d04..076890fe6d 100644 --- a/plugins/Dbx_mdb/src/dbcontacts.cpp +++ b/plugins/Dbx_mdb/src/dbcontacts.cpp @@ -116,16 +116,16 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID) key.mv_size = sizeof(keyS); key.mv_data = &keyS;
- mdb_cursor_get(cursor, &key, &data, MDB_SET_RANGE);
-
- do
+ if (mdb_cursor_get(cursor, &key, &data, MDB_SET_RANGE))
{
- const DBSettingKey *pKey = (const DBSettingKey*)key.mv_data;
- if (pKey->dwContactID != contactID)
- break;
- mdb_cursor_del(cursor, 0);
- }
- while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS);
+ do
+ {
+ const DBSettingKey *pKey = (const DBSettingKey*)key.mv_data;
+ if (pKey->dwContactID != contactID)
+ break;
+ mdb_cursor_del(cursor, 0);
+ } while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS);
+ }
txn.commit();
}
|