Added missing allocation check in attestation_utils.cpp

In preparation to moving attestation_utils.cpp to keymaster_portable
we found a missing memory allocation check.

Test: no
Change-Id: I0519df63f486d6e979965496a344089f04384e86
diff --git a/km_openssl/attestation_utils.cpp b/km_openssl/attestation_utils.cpp
index 9805ff3..edeb6f9 100644
--- a/km_openssl/attestation_utils.cpp
+++ b/km_openssl/attestation_utils.cpp
@@ -201,6 +201,7 @@
                                                  X509* certificate) {
     // Build BIT_STRING with correct contents.
     ASN1_BIT_STRING_Ptr key_usage(ASN1_BIT_STRING_new());
+    if (!key_usage) return KM_ERROR_MEMORY_ALLOCATION_FAILED;
 
     for (size_t i = 0; i <= kMaxKeyUsageBit; ++i) {
         if (!ASN1_BIT_STRING_set_bit(key_usage.get(), i, 0)) {