Free OpenSSL keys in ./configure

Failure to free OpenSSL keys in ./configure results in ASAN errors and
false negative errors.
This commit is contained in:
Mark Andrews
2021-02-08 08:57:06 +01:00
committed by Michal Nowak
parent f082ed9d57
commit edd6d5884a
2 changed files with 20 additions and 4 deletions
Vendored
+10 -2
View File
@@ -17511,6 +17511,10 @@ int main() {
ec384 = EC_KEY_new_by_curve_name(NID_secp384r1);
if (ec256 == NULL || ec384 == NULL)
return (2);
if (ec256 != NULL)
EC_KEY_free(ec256);
if (ec384 != NULL)
EC_KEY_free(ec384);
return (0);
}
@@ -17657,8 +17661,10 @@ int main() {
EVP_PKEY_CTX *ctx;
ctx = EVP_PKEY_CTX_new_id(NID_ED25519, NULL);
if (ctx == NULL)
if (ctx == NULL) {
return (2);
}
EVP_PKEY_CTX_free(ctx);
return (0);
}
@@ -17715,8 +17721,10 @@ int main() {
EVP_PKEY_CTX *ctx;
ctx = EVP_PKEY_CTX_new_id(NID_ED448, NULL);
if (ctx == NULL)
if (ctx == NULL) {
return (2);
}
EVP_PKEY_CTX_free(ctx);
return (0);
}
+10 -2
View File
@@ -1806,6 +1806,10 @@ int main() {
ec384 = EC_KEY_new_by_curve_name(NID_secp384r1);
if (ec256 == NULL || ec384 == NULL)
return (2);
if (ec256 != NULL)
EC_KEY_free(ec256);
if (ec384 != NULL)
EC_KEY_free(ec384);
return (0);
}
],
@@ -1918,8 +1922,10 @@ int main() {
EVP_PKEY_CTX *ctx;
ctx = EVP_PKEY_CTX_new_id(NID_ED25519, NULL);
if (ctx == NULL)
if (ctx == NULL) {
return (2);
}
EVP_PKEY_CTX_free(ctx);
return (0);
}
],
@@ -1959,8 +1965,10 @@ int main() {
EVP_PKEY_CTX *ctx;
ctx = EVP_PKEY_CTX_new_id(NID_ED448, NULL);
if (ctx == NULL)
if (ctx == NULL) {
return (2);
}
EVP_PKEY_CTX_free(ctx);
return (0);
}
],