From 68e33037c2e3ee88c2f07e6259cb0ec3c5a5e54f Mon Sep 17 00:00:00 2001 From: miod <> Date: Sun, 18 May 2014 19:35:04 +0000 Subject: If you need to allocate `a + b' bytes of memory, then don't allocate `a + b*2', this is confusing and unnecessary. Help (coz I got confused) and ok guenther@ beck@ --- src/lib/libcrypto/asn1/f_int.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/asn1/f_int.c') diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c index 283860d72d..192e2f374f 100644 --- a/src/lib/libcrypto/asn1/f_int.c +++ b/src/lib/libcrypto/asn1/f_int.c @@ -158,14 +158,14 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) } i /= 2; if (num + i > slen) { - sp = OPENSSL_realloc_clean(s, slen, num + i * 2); + sp = OPENSSL_realloc_clean(s, slen, num + i); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); goto err; } s = sp; - slen = num + i * 2; + slen = num + i; } for (j = 0; j < i; j++, k += 2) { for (n = 0; n < 2; n++) { -- cgit v1.2.3-55-g6feb