]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/bn/bn_conv.c
Stop raising ERR_R_MALLOC_FAILURE in most places
[thirdparty/openssl.git] / crypto / bn / bn_conv.c
index 75054f5d6a6c7432773276b077dc498e65b9ed64..849440e71e773e9a8412355bc5d59db2c5d625c8 100644 (file)
@@ -23,10 +23,8 @@ char *BN_bn2hex(const BIGNUM *a)
     if (BN_is_zero(a))
         return OPENSSL_strdup("0");
     buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
-    if (buf == NULL) {
-        ERR_raise(ERR_LIB_BN, ERR_R_MALLOC_FAILURE);
+    if (buf == NULL)
         goto err;
-    }
     p = buf;
     if (a->neg)
         *p++ = '-';
@@ -70,10 +68,8 @@ char *BN_bn2dec(const BIGNUM *a)
     bn_data_num = num / BN_DEC_NUM + 1;
     bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
     buf = OPENSSL_malloc(tbytes);
-    if (buf == NULL || bn_data == NULL) {
-        ERR_raise(ERR_LIB_BN, ERR_R_MALLOC_FAILURE);
+    if (buf == NULL || bn_data == NULL)
         goto err;
-    }
     if ((t = BN_dup(a)) == NULL)
         goto err;