From dab7d09570ebcd1f370e555c84349f14c20a1b8d Mon Sep 17 00:00:00 2001 From: Aaron Jense Date: Wed, 13 Nov 2019 11:55:45 -0700 Subject: [PATCH] Fix the possibility that memory is not free'd when GetLength returns 0 --- wolfcrypt/src/pkcs12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/pkcs12.c b/wolfcrypt/src/pkcs12.c index 9f641721c..fca9d6d58 100644 --- a/wolfcrypt/src/pkcs12.c +++ b/wolfcrypt/src/pkcs12.c @@ -1070,7 +1070,7 @@ int wc_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw, ERROR_OUT(ASN_PARSE_E, exit_pk12par); } if ((ret = GetLength(data, &idx, &size, ci->dataSz)) <= 0) { - goto exit_pk12par; + ERROR_OUT(ASN_PARSE_E, exit_pk12par); } if (GetASNTag(data, &idx, &tag, ci->dataSz) < 0) {