cleanup memory on structure free

This commit is contained in:
JacobBarthelmeh
2022-05-11 21:57:13 -07:00
parent 818ac2b8dd
commit 36739bca62
2 changed files with 2 additions and 1 deletions

View File

@@ -4012,7 +4012,7 @@ void FreeX509(WOLFSSL_X509* x509)
#endif /* OPENSSL_ALL */
#if defined(WOLFSSL_CERT_REQ) && defined(OPENSSL_ALL)
if (x509->reqAttributes) {
wolfSSL_sk_free(x509->reqAttributes);
wolfSSL_sk_pop_free(x509->reqAttributes, NULL);
}
#endif /* WOLFSSL_CERT_REQ */
if (x509->altNames) {

View File

@@ -12342,6 +12342,7 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
else {
if (req->reqAttributes == NULL) {
req->reqAttributes = wolfSSL_sk_new_node(req->heap);
req->reqAttributes->type = STACK_TYPE_X509_REQ_ATTR;
}
ret = wolfSSL_sk_push(req->reqAttributes, attr);
}