From b0cb22b07c71c13412c633c816afb5afccdb84b7 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 27 Apr 2016 14:50:32 +0100 Subject: [PATCH] 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 --- crypto/asn1/f_int.c | 1 + 1 file changed, 1 insertion(+) 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; } -- GitLab