diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-28 16:34:52 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-28 16:34:52 -0400 |
commit | 2d29e2df0c9040e139d68c8659ee0342a6ac3dd1 (patch) | |
tree | 1c204074c02b3e356e60b51abe82e4552983bc80 /crypto/asn1/f_enum.c | |
parent | b196e7d936fb377d9c5b305748ac25ff0e53ef6d (diff) | |
download | openssl-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/f_enum.c')
-rw-r--r-- | crypto/asn1/f_enum.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/asn1/f_enum.c b/crypto/asn1/f_enum.c index c623cdc784..2ec99a51a3 100644 --- a/crypto/asn1/f_enum.c +++ b/crypto/asn1/f_enum.c @@ -151,10 +151,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) } i /= 2; if (num + i > slen) { - if (s == NULL) - sp = OPENSSL_malloc((unsigned int)num + i * 2); - else - sp = OPENSSL_realloc(s, (unsigned int)num + i * 2); + sp = OPENSSL_realloc(s, (unsigned int)num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); if (s != NULL) |