From fbf91f7397d8d82389fade52774c48783241c149 Mon Sep 17 00:00:00 2001 From: Tesfa Mael Date: Wed, 15 Jan 2020 16:03:42 -0800 Subject: [PATCH] Fix mem leak in DSA --- wolfcrypt/src/asn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 44887763f..cd64eb746 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4622,6 +4622,7 @@ int DsaPrivateKeyDecode(const byte* input, word32* inOutIdx, DsaKey* key, GetInt(&key->g, input, inOutIdx, inSz) < 0 || GetOctetString(input, inOutIdx, &length, inSz) < 0 || GetInt(&key->y, input, inOutIdx, inSz) < 0) { + wc_FreeDsaKey(key); ret = ASN_PARSE_E; } if (ret == ASN_PARSE_E) {