Fix the possibility that memory is not free'd when GetLength returns 0

This commit is contained in:
Aaron Jense
2019-11-13 11:55:45 -07:00
parent 0beeb2356b
commit dab7d09570

View File

@ -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) {