From 0dbc087eab5cf1d107069a2043fefea02861d1b6 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Sat, 24 Jun 2017 16:31:59 -0700 Subject: [PATCH] Correct openssl error logging [ Merge of http://go/wvgerrit/29041/ ] Releasing allocated BIO buffers before logging failure causes the openssl error to be erased. b/62486203 Test: Ran WV unit, integration tests on angler Change-Id: I3315edae2d3bd34887569ab88817f9591c12f409 --- libwvdrmengine/cdm/core/src/privacy_crypto_openssl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libwvdrmengine/cdm/core/src/privacy_crypto_openssl.cpp b/libwvdrmengine/cdm/core/src/privacy_crypto_openssl.cpp index 2d304e27..eabf667d 100644 --- a/libwvdrmengine/cdm/core/src/privacy_crypto_openssl.cpp +++ b/libwvdrmengine/cdm/core/src/privacy_crypto_openssl.cpp @@ -29,14 +29,15 @@ RSA* GetKey(const std::string& serialized_key) { return NULL; } RSA* key = d2i_RSAPublicKey_bio(bio, NULL); - BIO_free(bio); if (key == NULL) { LOGE("GetKey: RSA key deserialization failure: %s", ERR_error_string(ERR_get_error(), NULL)); + BIO_free(bio); return NULL; } + BIO_free(bio); return key; }