From: Matt Caswell Date: Wed, 27 Apr 2016 13:50:32 +0000 (+0100) Subject: Free buffer on error in a2i_ASN1_INTEGER() X-Git-Tag: OpenSSL_1_1_0-pre6~610 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0cb22b07c71c13412c633c816afb5afccdb84b7;p=oweals%2Fopenssl.git Free buffer on error in a2i_ASN1_INTEGER() The function a2i_ASN1_INTEGER() allocates a buffer |s| but then fails to free it on error paths. Reviewed-by: Richard Levitte --- diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c index 15aece99e8..0f16ac0bbb 100644 --- a/crypto/asn1/f_int.c +++ b/crypto/asn1/f_int.c @@ -148,6 +148,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) return 1; err: ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); + OPENSSL_free(s); return 0; }