diff --git a/mailnews/extensions/smime/nsCertPicker.cpp b/mailnews/extensions/smime/nsCertPicker.cpp index d06eec45ec..6a4095d00d 100644 --- a/mailnews/extensions/smime/nsCertPicker.cpp +++ b/mailnews/extensions/smime/nsCertPicker.cpp @@ -294,7 +294,7 @@ NS_IMETHODIMP nsCertPicker::PickByUsage(nsIInterfaceRequestor* ctx, while (!CERT_LIST_END(node, certList)) { /* if the cert has at least one e-mail address, check if suitable */ if (CERT_GetFirstEmailAddress(node->cert)) { - RefPtr tempCert(nsNSSCertificate::Create(node->cert)); + RefPtr tempCert(new nsNSSCertificate(node->cert)); bool match = false; rv = tempCert->ContainsEmailAddress(emailAddress, &match); if (NS_FAILED(rv)) { @@ -326,7 +326,7 @@ NS_IMETHODIMP nsCertPicker::PickByUsage(nsIInterfaceRequestor* ctx, !CERT_LIST_END(node, certList.get()) && CertsToUse < nicknames->numnicknames; node = CERT_LIST_NEXT(node)) { - RefPtr tempCert(nsNSSCertificate::Create(node->cert)); + RefPtr tempCert(new nsNSSCertificate(node->cert)); if (tempCert) { nsAutoString i_nickname( @@ -382,12 +382,7 @@ NS_IMETHODIMP nsCertPicker::PickByUsage(nsIInterfaceRequestor* ctx, for (i = 0, node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node, certList); ++i, node = CERT_LIST_NEXT(node)) { if (i == selectedIndex) { - RefPtr cert = nsNSSCertificate::Create(node->cert); - if (!cert) { - rv = NS_ERROR_OUT_OF_MEMORY; - break; - } - + RefPtr cert = new nsNSSCertificate(node->cert); cert.forget(_retval); break; } diff --git a/mailnews/extensions/smime/nsMsgComposeSecure.cpp b/mailnews/extensions/smime/nsMsgComposeSecure.cpp index 38dc7a50f0..b202190f7b 100644 --- a/mailnews/extensions/smime/nsMsgComposeSecure.cpp +++ b/mailnews/extensions/smime/nsMsgComposeSecure.cpp @@ -1149,9 +1149,7 @@ nsMsgComposeSecure::FindCertByEmailAddress(const nsACString& aEmailAddress, // |node| now contains the first valid (if aRequireValidCert true) // certificate with correct usage. - RefPtr nssCert = nsNSSCertificate::Create(node->cert); - if (!nssCert) return NS_ERROR_OUT_OF_MEMORY; - + RefPtr nssCert = new nsNSSCertificate(node->cert); nssCert.forget(_retval); return NS_OK; }