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>
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index 7d398d9..765efe4 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -364,12 +364,14 @@
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 @@
X509_STORE_free(*pstore);
*pstore = store;
if (ref && store)
- X509_up_ref(store);
+ CRYPTO_add(&store->references, 1, CRYPTO_LOCK_X509_STORE);
return 1;
}