summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 05:32:29 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 05:32:29 +0000
commitfbb7a3506e58ce45043e26c71b3ee6f38d19fa7d (patch)
treeef4128deb9641db5e05926eb21800c36165b6899 /net
parentfa95029a5cac6ea856d272f1f1968bcacff78c0b (diff)
downloadchromium_src-fbb7a3506e58ce45043e26c71b3ee6f38d19fa7d.zip
chromium_src-fbb7a3506e58ce45043e26c71b3ee6f38d19fa7d.tar.gz
chromium_src-fbb7a3506e58ce45043e26c71b3ee6f38d19fa7d.tar.bz2
Fix leaking CERTCertificate in NSS X509Certificate::CreateSelfSigned.
BUG=100761,88782 TEST=valgrind bots Review URL: http://codereview.chromium.org/8342064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/x509_certificate_nss.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc
index 039edad..26b74c1 100644
--- a/net/base/x509_certificate_nss.cc
+++ b/net/base/x509_certificate_nss.cc
@@ -640,8 +640,10 @@ X509Certificate* X509Certificate::CreateSelfSigned(
if (!cert)
return NULL;
- return X509Certificate::CreateFromHandle(cert,
- X509Certificate::OSCertHandles());
+ X509Certificate* x509_cert = X509Certificate::CreateFromHandle(
+ cert, X509Certificate::OSCertHandles());
+ CERT_DestroyCertificate(cert);
+ return x509_cert;
}
void X509Certificate::GetSubjectAltName(