remove malloc casts
[openssl.git] / crypto / asn1 / a_bitstr.c
index 24cdb0f66a6b7505f81269ad32a01037ddad8700..8a9e17cb27c3e7c78e872869da065abd663607e2 100644 (file)
@@ -156,7 +156,7 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
     ret->flags |= (ASN1_STRING_FLAG_BITS_LEFT | i); /* set */
 
     if (len-- > 1) {            /* using one because of the bits left byte */
-        s = (unsigned char *)OPENSSL_malloc((int)len);
+        s = OPENSSL_malloc((int)len);
         if (s == NULL) {
             i = ERR_R_MALLOC_FAILURE;
             goto err;
@@ -206,10 +206,9 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
         if (!value)
             return (1);         /* Don't need to set */
         if (a->data == NULL)
-            c = (unsigned char *)OPENSSL_malloc(w + 1);
+            c = OPENSSL_malloc(w + 1);
         else
-            c = (unsigned char *)OPENSSL_realloc_clean(a->data,
-                                                       a->length, w + 1);
+            c = OPENSSL_realloc_clean(a->data, a->length, w + 1);
         if (c == NULL) {
             ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT, ERR_R_MALLOC_FAILURE);
             return 0;