]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Free OpenSSL keys in ./configure
authorMark Andrews <marka@isc.org>
Fri, 5 Feb 2021 06:08:33 +0000 (17:08 +1100)
committerMichal Nowak <mnowak@isc.org>
Mon, 8 Feb 2021 07:57:06 +0000 (08:57 +0100)
Failure to free OpenSSL keys in ./configure results in ASAN errors and
false negative errors.

configure
configure.ac

index 4b6b1e11f3ece4552521eb71576adb0589353aea..f56d94deb050cc20c2b1b6eecdab8c2c9346fa83 100755 (executable)
--- a/configure
+++ b/configure
@@ -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);
 }
 
index 6ecdbf9b34fbfef7b0db730cf76ddc2057913f60..2aa1ff87f739888cd3110adcea6a0a9f05075cc7 100644 (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);
 }
 ],