Don't X509_up_ref X509_STOREs.

Change-Id: Ic78bec93aedcc06c1496fe374e1c1c77ef70ea4b
Reviewed-on: https://boringssl-review.googlesource.com/1416
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2014-08-06 22:15:46 -04:00 committed by Adam Langley
parent 7fdeaf1101
commit 67454b6f76

View File

@ -364,12 +364,14 @@ CERT *ssl_cert_dup(CERT *cert)
if (cert->verify_store)
{
ret->verify_store = X509_up_ref(cert->verify_store);
CRYPTO_add(&cert->verify_store->references, 1, CRYPTO_LOCK_X509_STORE);
ret->verify_store = cert->verify_store;
}
if (cert->chain_store)
{
ret->chain_store = X509_up_ref(cert->chain_store);
CRYPTO_add(&cert->chain_store->references, 1, CRYPTO_LOCK_X509_STORE);
ret->chain_store = cert->chain_store;
}
ret->ciphers_raw = NULL;
@ -1211,7 +1213,7 @@ int ssl_cert_set_cert_store(CERT *c, X509_STORE *store, int chain, int ref)
X509_STORE_free(*pstore);
*pstore = store;
if (ref && store)
X509_up_ref(store);
CRYPTO_add(&store->references, 1, CRYPTO_LOCK_X509_STORE);
return 1;
}