From 2d29e2df0c9040e139d68c8659ee0342a6ac3dd1 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Tue, 28 Apr 2015 16:34:52 -0400 Subject: realloc of NULL is like malloc ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte --- crypto/asn1/f_string.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crypto/asn1/f_string.c') diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c index 6cb4cfdff9..53f8cf3a83 100644 --- a/crypto/asn1/f_string.c +++ b/crypto/asn1/f_string.c @@ -157,10 +157,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *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_STRING, ERR_R_MALLOC_FAILURE); if (s != NULL) -- cgit v1.2.3