Index: net/android/keystore_openssl.cc |
diff --git a/net/android/keystore_openssl.cc b/net/android/keystore_openssl.cc |
index 5ad847344aaee22b414d3e0dbd2e610a7e85ce71..afdca30de0d772d51261d9dfa7dbda242374e0bf 100644 |
--- a/net/android/keystore_openssl.cc |
+++ b/net/android/keystore_openssl.cc |
@@ -208,8 +208,7 @@ int RsaMethodFinish(RSA* rsa) { |
jobject key = reinterpret_cast<jobject>(RSA_get_app_data(rsa)); |
if (key != NULL) { |
RSA_set_app_data(rsa, NULL); |
- JNIEnv* env = base::android::AttachCurrentThread(); |
- env->DeleteGlobalRef(key); |
+ ReleaseKey(key); |
} |
// Actual return value is ignored by OpenSSL. There are no docs |
// explaining what this is supposed to be. |
@@ -413,8 +412,7 @@ int DsaMethodFinish(DSA* dsa) { |
jobject key = reinterpret_cast<jobject>(DSA_get_ex_data(dsa,0)); |
if (key != NULL) { |
DSA_set_ex_data(dsa, 0, NULL); |
- JNIEnv* env = base::android::AttachCurrentThread(); |
- env->DeleteGlobalRef(key); |
+ ReleaseKey(key); |
} |
// Actual return value is ignored by OpenSSL. There are no docs |
// explaining what this is supposed to be. |
@@ -493,9 +491,7 @@ void ExDataFree(void* parent, |
return; |
CRYPTO_set_ex_data(ad, idx, NULL); |
- |
- JNIEnv* env = base::android::AttachCurrentThread(); |
- env->DeleteGlobalRef(private_key); |
+ ReleaseKey(private_key); |
} |
int ExDataDup(CRYPTO_EX_DATA* to, |