diff options
Diffstat (limited to 'src/manager/common/certificate-impl.cpp')
-rw-r--r-- | src/manager/common/certificate-impl.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/manager/common/certificate-impl.cpp b/src/manager/common/certificate-impl.cpp index 316085db..0577958c 100644 --- a/src/manager/common/certificate-impl.cpp +++ b/src/manager/common/certificate-impl.cpp @@ -91,7 +91,8 @@ CertificateImpl::CertificateImpl(CertificateImpl &&second) { CertificateImpl& CertificateImpl::operator=(CertificateImpl &&second) { if (this == &second) return *this; - X509_free(m_x509); + if(m_x509) + X509_free(m_x509); m_x509 = second.m_x509; second.m_x509 = NULL; LogDebug("Certificate moved: " << (void*)m_x509); @@ -101,7 +102,8 @@ CertificateImpl& CertificateImpl::operator=(CertificateImpl &&second) { CertificateImpl& CertificateImpl::operator=(const CertificateImpl &second) { if (this == &second) return *this; - X509_free(m_x509); + if(m_x509) + X509_free(m_x509); m_x509 = X509_dup(second.m_x509); return *this; } @@ -258,7 +260,8 @@ std::string CertificateImpl::getOCSPURL() const { } CertificateImpl::~CertificateImpl() { - X509_free(m_x509); + if(m_x509) + X509_free(m_x509); } CertificateShPtr Certificate::create(const RawBuffer &rawBuffer, DataFormat format) { |