Skip to content

Commit 65f9cdb

Browse files
committed
free p2 before reassigning to reEncoded value
1 parent a40b56c commit 65f9cdb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19598,6 +19598,9 @@ static int test_wolfSSL_d2i_ASN1_INTEGER(void)
1959819598
a->isDynamic = 0;
1959919599
a->data = a->intData;
1960019600
}
19601+
/* Reset p2 to NULL. */
19602+
XFREE(p2, NULL, DYNAMIC_TYPE_ASN1);
19603+
1960119604
/* Set a to valid value. */
1960219605
ExpectIntEQ(wolfSSL_ASN1_INTEGER_set(a, 1), WOLFSSL_SUCCESS);
1960319606
/* NULL output buffer. */
@@ -19637,7 +19640,6 @@ static int test_wolfSSL_d2i_ASN1_INTEGER(void)
1963719640
reEncoded = NULL;
1963819641
wolfSSL_ASN1_INTEGER_free(a);
1963919642
a = NULL;
19640-
p2 = NULL;
1964119643
}
1964219644
#endif /* OPENSSL_EXTRA */
1964319645
return EXPECT_RESULT();

0 commit comments

Comments
 (0)