Unit test: fix coverity issue

test_wolfSSL_i2d_ASN1_TYPE: don't use str after freeing it.
This commit is contained in:
Sean Parkinson
2024-10-16 12:40:02 +10:00
parent db6a2ccdca
commit b8d3b990ea

View File

@ -55190,10 +55190,12 @@ static int test_wolfSSL_i2d_ASN1_TYPE(void)
ExpectNotNull(str = ASN1_STRING_type_new(V_ASN1_SEQUENCE));
ExpectIntEQ(ASN1_STRING_set(str, str_bin, sizeof(str_bin)), 1);
ExpectNotNull(asn1type = ASN1_TYPE_new());
if (EXPECT_FAIL()) {
if (asn1type != NULL) {
ASN1_TYPE_set(asn1type, V_ASN1_SEQUENCE, str);
}
else {
ASN1_STRING_free(str);
}
ASN1_TYPE_set(asn1type, V_ASN1_SEQUENCE, str);
}
ExpectIntEQ(i2d_ASN1_TYPE(asn1type, NULL), sizeof(str_bin));