Merge pull request #6159 from philljj/zd15693

Fix ASN1_STRING leak in create_by_NID and create_by_txt
This commit is contained in:
David Garske
2023-03-06 09:25:37 -08:00
committed by GitHub

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;