Stop raising ERR_R_MALLOC_FAILURE in most places
[openssl.git] / crypto / asn1 / tasn_utl.c
index e5f25d88df69f96e0c5a23385b017ebd07b4c284..be8931cab468867008f5ce187619579e2b753f94 100644 (file)
@@ -86,7 +86,7 @@ int ossl_asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it)
         *lck = ret = 1;
         *lock = CRYPTO_THREAD_lock_new();
         if (*lock == NULL) {
-            ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
             return -1;
         }
         break;
@@ -168,10 +168,8 @@ int ossl_asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
     OPENSSL_free(enc->enc);
     if (inlen <= 0)
         return 0;
-    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL) {
-        ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
         return 0;
-    }
     memcpy(enc->enc, in, inlen);
     enc->len = inlen;
     enc->modified = 0;