mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
misc: use std::make_unique
This commit is contained in:
1 parent
baa2a5d21c
commit
d825f4e5ae
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -296,8 +296,8 @@ Value::decrypt(const crypto::PrivateKey& key)
|
||||
decrypted = true;
|
||||
if (isEncrypted()) {
|
||||
auto decryptedBlob = key.decrypt(cypher);
|
||||
std::unique_ptr<Value> v {new Value(id)};
|
||||
auto msg = msgpack::unpack((const char*)decryptedBlob.data(), decryptedBlob.size());
|
||||
auto v = std::make_unique<Value>(id);
|
||||
v->msgpack_unpack_body(msg.get());
|
||||
if (v->recipient != key.getPublicKey().getId())
|
||||
throw crypto::DecryptError("Recipient mismatch");
|
||||
|
||||
Reference in new issue
Block a user