Skip to content
Snippets Groups Projects
Commit 0eed7ec5 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

certstore: fix memory leak

Change-Id: I26c75c979d1fc0d2c18fdcecea55137319c4f8f4
parent ebb16c18
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment