Commit 0eed7ec5 authored by Adrien Béraud's avatar Adrien Béraud

certstore: fix memory leak

Change-Id: I26c75c979d1fc0d2c18fdcecea55137319c4f8f4
parent ebb16c18
......@@ -414,6 +414,19 @@ TrustStore::~TrustStore()
gnutls_x509_trust_list_deinit(allowed_, false);
}
TrustStore&
TrustStore::operator=(TrustStore&& o)
{
unknownCertStatus_ = std::move(o.unknownCertStatus_);
certStatus_ = std::move(o.certStatus_);
revokedList_ = std::move(o.revokedList_);
if (allowed_)
gnutls_x509_trust_list_deinit(allowed_, false);
allowed_ = std::move(o.allowed_);
o.allowed_ = nullptr;
return *this;
}
bool
TrustStore::addRevocationList(dht::crypto::RevocationList&& crl)
{
......
......@@ -119,14 +119,7 @@ public:
o.allowed_ = nullptr;
}
TrustStore& operator=(TrustStore&& o) {
unknownCertStatus_ = std::move(o.unknownCertStatus_);
certStatus_ = std::move(o.certStatus_);
revokedList_ = std::move(o.revokedList_),
allowed_ = std::move(o.allowed_);
o.allowed_ = nullptr;
return *this;
}
TrustStore& operator=(TrustStore&& o);
enum class PermissionStatus {
UNDEFINED = 0,
......
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