altarch-user / rpms / httpd

Forked from rpms/httpd 2 years ago
Clone

Blame SOURCES/httpd-2.4.6-dhparams-free.patch

07ea28
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
07ea28
index ee46db4..c560422 100644
07ea28
--- a/modules/ssl/ssl_engine_init.c
07ea28
+++ b/modules/ssl/ssl_engine_init.c
07ea28
@@ -915,7 +915,7 @@ static void ssl_init_server_certs(server_rec *s,
07ea28
     const char *rsa_id, *dsa_id;
07ea28
 #ifndef OPENSSL_NO_EC
07ea28
     const char *ecc_id;
07ea28
-    EC_GROUP *ecparams;
07ea28
+    EC_GROUP *ecparams = NULL;
07ea28
     int nid;
07ea28
     EC_KEY *eckey = NULL;
07ea28
 #endif
07ea28
@@ -988,6 +988,7 @@ static void ssl_init_server_certs(server_rec *s,
07ea28
                      "Custom DH parameters (%d bits) for %s loaded from %s",
07ea28
                      BN_num_bits(dhparams->p), vhost_id,
07ea28
                      mctx->pks->cert_files[0]);
07ea28
+        DH_free(dhparams);
07ea28
     }
07ea28
 
07ea28
 #ifndef OPENSSL_NO_EC
07ea28
@@ -1012,6 +1013,9 @@ static void ssl_init_server_certs(server_rec *s,
07ea28
         SSL_CTX_set_tmp_ecdh(mctx->ssl_ctx, eckey);
07ea28
 #endif
07ea28
     }
07ea28
+    if (ecparams) {
07ea28
+        EC_GROUP_free(ecparams);
07ea28
+    }
07ea28
     EC_KEY_free(eckey);
07ea28
 #endif
07ea28
 }