diff options
author | 2014-04-21 11:37:41 +0000 | |
---|---|---|
committer | 2014-04-21 11:37:41 +0000 | |
commit | 6dae11f4ef996ad1ad3f526b8099c5f4d1e3f5a2 (patch) | |
tree | 26fbaa6b0969f88dc2c446302af9d8659bca8037 /lib/libssl/src/crypto/asn1/f_string.c | |
parent | Use internal '__' names for __attributes__ in public headers (diff) | |
download | wireguard-openbsd-6dae11f4ef996ad1ad3f526b8099c5f4d1e3f5a2.tar.xz wireguard-openbsd-6dae11f4ef996ad1ad3f526b8099c5f4d1e3f5a2.zip |
improve realloc/calloc/malloc patterns; ok guenther
Diffstat (limited to 'lib/libssl/src/crypto/asn1/f_string.c')
-rw-r--r-- | lib/libssl/src/crypto/asn1/f_string.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/libssl/src/crypto/asn1/f_string.c b/lib/libssl/src/crypto/asn1/f_string.c index d42bcdb6ea9..c213c7a88d3 100644 --- a/lib/libssl/src/crypto/asn1/f_string.c +++ b/lib/libssl/src/crypto/asn1/f_string.c @@ -150,12 +150,7 @@ a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) } i /= 2; if (num + i > slen) { - if (s == NULL) - sp = (unsigned char *)malloc( - (unsigned int)num + i * 2); - else - sp = (unsigned char *)realloc(s, - (unsigned int)num + i * 2); + sp = realloc(s, (unsigned int)num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE); |