forked from wolfSSL/wolfssl
Unit test: fix coverity issue
test_wolfSSL_i2d_ASN1_TYPE: don't use str after freeing it.
This commit is contained in:
@ -55190,10 +55190,12 @@ static int test_wolfSSL_i2d_ASN1_TYPE(void)
|
|||||||
ExpectNotNull(str = ASN1_STRING_type_new(V_ASN1_SEQUENCE));
|
ExpectNotNull(str = ASN1_STRING_type_new(V_ASN1_SEQUENCE));
|
||||||
ExpectIntEQ(ASN1_STRING_set(str, str_bin, sizeof(str_bin)), 1);
|
ExpectIntEQ(ASN1_STRING_set(str, str_bin, sizeof(str_bin)), 1);
|
||||||
ExpectNotNull(asn1type = ASN1_TYPE_new());
|
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_STRING_free(str);
|
||||||
}
|
}
|
||||||
ASN1_TYPE_set(asn1type, V_ASN1_SEQUENCE, str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpectIntEQ(i2d_ASN1_TYPE(asn1type, NULL), sizeof(str_bin));
|
ExpectIntEQ(i2d_ASN1_TYPE(asn1type, NULL), sizeof(str_bin));
|
||||||
|
Reference in New Issue
Block a user