Need to free x509 in tests

pull/4459/head
Juliusz Sosinowicz 2021-10-26 21:53:44 +02:00
parent a738c16b2f
commit 8cba5dda17
2 changed files with 4 additions and 0 deletions

View File

@ -46003,6 +46003,9 @@ int wolfSSL_PEM_write_bio_X509(WOLFSSL_BIO *bio, WOLFSSL_X509 *cert)
/* write the PEM to BIO */
ret = wolfSSL_BIO_write(bio, pem, pemSz);
XFREE(pem, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#ifdef WOLFSSL_SMALL_STACK
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif
if (ret <= 0) return WOLFSSL_FAILURE;
return WOLFSSL_SUCCESS;

View File

@ -37659,6 +37659,7 @@ static void test_wolfSSL_PEM_write_bio_X509(void)
#endif
AssertIntEQ(wolfSSL_BIO_get_len(output), expectedLen);
X509_free(x509);
BIO_free(input);
BIO_free(output);