Fix ASN1_STRING leak in create_by_NID and create_by_txt

This commit is contained in:
jordan
2023-03-03 08:22:35 -06:00
parent 4ebc896231
commit 51dbb44799

View File

@ -11125,6 +11125,11 @@ err:
dataSz) == WOLFSSL_SUCCESS) { dataSz) == WOLFSSL_SUCCESS) {
ne->set = 1; ne->set = 1;
} }
else {
/* Free the ASN1_STRING if it is not set. */
wolfSSL_ASN1_STRING_free(ne->value);
ne->value = NULL;
}
} }
} }
@ -11174,6 +11179,11 @@ err:
== WOLFSSL_SUCCESS) { == WOLFSSL_SUCCESS) {
ne->set = 1; ne->set = 1;
} }
else {
/* Free the ASN1_STRING if it is not set. */
wolfSSL_ASN1_STRING_free(ne->value);
ne->value = NULL;
}
} }
return ne; return ne;