From 20562b3f784b9764d38901acc7ee3bd7aa9348f8 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 14 Mar 2022 09:14:19 +1000 Subject: [PATCH] DecodeNameConstraints (ASN Template): free ASNGetData --- wolfcrypt/src/asn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 86f723b05..44e9177e0 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -16198,8 +16198,8 @@ static int DecodeNameConstraints(const byte* input, int sz, DecodedCert* cert) if (ret == 0) { /* Parse NameConstraints. */ - ret = GetASN_Items(nameConstraintsASN, dataASN, nameConstraintsASN_Length, - 1, input, &idx, sz); + ret = GetASN_Items(nameConstraintsASN, dataASN, + nameConstraintsASN_Length, 1, input, &idx, sz); } if (ret == 0) { /* If there was a permittedSubtrees then parse it. */ @@ -16220,6 +16220,8 @@ static int DecodeNameConstraints(const byte* input, int sz, DecodedCert* cert) } } + FREE_ASNGETDATA(dataASN, cert->heap); + return ret; #endif /* WOLFSSL_ASN_TEMPLATE */ }