diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-28 17:11:00 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | b6312c4b5ab04be3f89b0d46c5546baa9feb542e (patch) | |
tree | ef5f1a6fe7400ff0c9724ef4bf0eebcaec98e051 | |
parent | 1e4dac83952e1f707cdb837f647e6c80c3414154 (diff) |
blalba
-rw-r--r-- | include/odhtdb/Database.hpp | 1 | ||||
-rw-r--r-- | src/Database.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp index ecdf70c..f222215 100644 --- a/include/odhtdb/Database.hpp +++ b/include/odhtdb/Database.hpp @@ -146,6 +146,7 @@ namespace odhtdb class Database { + DISABLE_COPY(Database) friend class DatabaseStorage; public: Database(const char *bootstrapNodeAddr, u16 port, const boost::filesystem::path &storageDir); diff --git a/src/Database.cpp b/src/Database.cpp index 7281025..492cc7d 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -344,7 +344,7 @@ namespace odhtdb Hash requestDataHash(stagedAddObject.data, stagedAddObject.size); DataView encryptedDataView((char*)requestData.data + serializer.getBuffer().size(), requestData.size - serializer.getBuffer().size()); databaseStorage.appendStorage(*nodeInfo.getRequestHash(), requestDataHash, DatabaseOperation::ADD_DATA, userToPerformActionWith, timestampMicroseconds, (u8*)stagedAddObject.data, stagedAddObject.size, encryptedDataView); - delete (char*)requestData.data; + delete[] (char*)requestData.data; stagedAddObjects.emplace_back(make_unique<StagedObject>(stagedAddObject, nodeInfo.getRequestHash())); } @@ -435,13 +435,13 @@ namespace odhtdb for(const auto &stagedObject : stagedCreateObjects) { - free(stagedObject->data.data); + delete[] (char*)stagedObject->data.data; } stagedCreateObjects.clear(); for(const auto &stagedObject : stagedAddObjects) { - free(stagedObject->data.data); + delete[] (char*)stagedObject->data.data; } stagedAddObjects.clear(); |