mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 04:34:41 +02:00
free decoded cert in test case and x509
This commit is contained in:
@@ -2278,7 +2278,6 @@ static void test_wolfSSL_FPKI(void)
|
|||||||
AssertTrue((f != XBADFILE));
|
AssertTrue((f != XBADFILE));
|
||||||
bytes = (int)XFREAD(buf, 1, sizeof(buf), f);
|
bytes = (int)XFREAD(buf, 1, sizeof(buf), f);
|
||||||
XFCLOSE(f);
|
XFCLOSE(f);
|
||||||
printf("size of file = %d\n", bytes);
|
|
||||||
|
|
||||||
wc_InitDecodedCert(&cert, buf, bytes, NULL);
|
wc_InitDecodedCert(&cert, buf, bytes, NULL);
|
||||||
AssertIntEQ(wc_ParseCert(&cert, CERT_TYPE, 0, NULL), 0);
|
AssertIntEQ(wc_ParseCert(&cert, CERT_TYPE, 0, NULL), 0);
|
||||||
@@ -2293,6 +2292,7 @@ printf("size of file = %d\n", bytes);
|
|||||||
AssertNotNull(uuid);
|
AssertNotNull(uuid);
|
||||||
AssertIntEQ(wc_GetUUIDFromCert(&cert, uuid, &uuidSz), 0);
|
AssertIntEQ(wc_GetUUIDFromCert(&cert, uuid, &uuidSz), 0);
|
||||||
XFREE(uuid, DYNAMIC_TYPE_TMP_BUFFER, NULL);
|
XFREE(uuid, DYNAMIC_TYPE_TMP_BUFFER, NULL);
|
||||||
|
wc_FreeDecodedCert(&cert);
|
||||||
|
|
||||||
printf(resultFmt, passed);
|
printf(resultFmt, passed);
|
||||||
#endif
|
#endif
|
||||||
@@ -9016,7 +9016,6 @@ static void test_wolfSSL_URI(void)
|
|||||||
|
|
||||||
x509 = wolfSSL_X509_load_certificate_file(uri, WOLFSSL_FILETYPE_PEM);
|
x509 = wolfSSL_X509_load_certificate_file(uri, WOLFSSL_FILETYPE_PEM);
|
||||||
AssertNotNull(x509);
|
AssertNotNull(x509);
|
||||||
|
|
||||||
wolfSSL_FreeX509(x509);
|
wolfSSL_FreeX509(x509);
|
||||||
|
|
||||||
x509 = wolfSSL_X509_load_certificate_file(badUri, WOLFSSL_FILETYPE_PEM);
|
x509 = wolfSSL_X509_load_certificate_file(badUri, WOLFSSL_FILETYPE_PEM);
|
||||||
@@ -9025,6 +9024,7 @@ static void test_wolfSSL_URI(void)
|
|||||||
AssertNull(x509);
|
AssertNull(x509);
|
||||||
#else
|
#else
|
||||||
AssertNotNull(x509);
|
AssertNotNull(x509);
|
||||||
|
wolfSSL_FreeX509(x509);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf(resultFmt, passed);
|
printf(resultFmt, passed);
|
||||||
|
Reference in New Issue
Block a user