postfix/postfix-ssl-release-buffers.patch
2017-04-08 22:23:20 +00:00

35 lines
980 B
Diff

Index: src/tls/tls_client.c
===================================================================
--- src/tls/tls_client.c.orig
+++ src/tls/tls_client.c
@@ -363,6 +363,12 @@ TLS_APPL_STATE *tls_client_init(const TL
SSL_CTX_set_security_level(client_ctx, 0);
#endif
+ /* Keep memory usage as low as possible */
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ SSL_CTX_set_mode(client_ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
/*
* See the verify callback in tls_verify.c
*/
Index: src/tls/tls_server.c
===================================================================
--- src/tls/tls_server.c.orig
+++ src/tls/tls_server.c
@@ -454,6 +454,12 @@ TLS_APPL_STATE *tls_server_init(const TL
SSL_CTX_set_security_level(server_ctx, 0);
#endif
+ /* Keep memory usage as low as possible */
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ SSL_CTX_set_mode(server_ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
/*
* See the verify callback in tls_verify.c
*/