Commit 90bd4f4d authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

corrected error with empty values

parent a9a6f6f3
......@@ -185,9 +185,11 @@ bool BerkeleyDBDataStore::get(const ds_bulk_t &key, ds_bulk_t &data) {
db_data.set_flags(DB_DBT_MALLOC);
status = _dbm->get(NULL, &db_key, &db_data, 0);
if (status != DB_NOTFOUND && status != DB_KEYEMPTY && db_data.get_size() > 0) {
if (status != DB_NOTFOUND && status != DB_KEYEMPTY) {
data.resize(db_data.get_size(), 0);
memcpy(&(data[0]), db_data.get_data(), db_data.get_size());
if(db_data.get_size() > 0) {
memcpy(&(data[0]), db_data.get_data(), db_data.get_size());
}
free(db_data.get_data());
success = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment