aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_bitstr.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-28 16:34:52 -0400
committerRich Salz <rsalz@openssl.org>2015-04-28 16:34:52 -0400
commit2d29e2df0c9040e139d68c8659ee0342a6ac3dd1 (patch)
tree1c204074c02b3e356e60b51abe82e4552983bc80 /crypto/asn1/a_bitstr.c
parentb196e7d936fb377d9c5b305748ac25ff0e53ef6d (diff)
downloadopenssl-2d29e2df0c9040e139d68c8659ee0342a6ac3dd1.tar.gz
realloc of NULL is like malloc
ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/asn1/a_bitstr.c')
-rw-r--r--crypto/asn1/a_bitstr.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c
index 8a9e17cb27..ba243f1a5f 100644
--- a/crypto/asn1/a_bitstr.c
+++ b/crypto/asn1/a_bitstr.c
@@ -205,10 +205,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
if ((a->length < (w + 1)) || (a->data == NULL)) {
if (!value)
return (1); /* Don't need to set */
- if (a->data == NULL)
- c = OPENSSL_malloc(w + 1);
- else
- c = 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;