dovecot-2.2: Memory leak fixes.
dovecot at dovecot.org
dovecot at dovecot.org
Sun May 20 03:26:32 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/584bd77c38fd
changeset: 14452:584bd77c38fd
user: Timo Sirainen <tss at iki.fi>
date: Wed Apr 11 19:06:44 2012 +0300
description:
Memory leak fixes.
diffstat:
src/lib-storage/index/index-thread.c | 3 +++
src/login-common/ssl-proxy-openssl.c | 9 +++++----
src/plugins/quota/quota.c | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diffs (72 lines):
diff -r 9cc178c7afb3 -r 584bd77c38fd src/lib-storage/index/index-thread.c
--- a/src/lib-storage/index/index-thread.c Wed Apr 11 18:23:34 2012 +0300
+++ b/src/lib-storage/index/index-thread.c Wed Apr 11 19:06:44 2012 +0300
@@ -325,6 +325,7 @@
if (seq1 == 0) {
/* nothing is missing */
mail_index_strmap_view_sync_commit(&ctx->strmap_sync);
+ mailbox_header_lookup_unref(&headers_ctx);
return 0;
}
@@ -332,6 +333,8 @@
mail_search_build_add_seqset(search_args, seq1, seq2);
search_ctx = mailbox_search_init(ctx->t, search_args, NULL,
0, headers_ctx);
+ mailbox_header_lookup_unref(&headers_ctx);
+ mail_search_args_unref(&search_args);
while (mailbox_search_next(search_ctx, &mail)) {
if (mail_thread_map_add_mail(ctx, mail) < 0) {
diff -r 9cc178c7afb3 -r 584bd77c38fd src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c Wed Apr 11 18:23:34 2012 +0300
+++ b/src/login-common/ssl-proxy-openssl.c Wed Apr 11 19:06:44 2012 +0300
@@ -942,7 +942,8 @@
}
static STACK_OF(X509_NAME) *
-ssl_proxy_ctx_init(SSL_CTX *ssl_ctx, const struct login_settings *set)
+ssl_proxy_ctx_init(SSL_CTX *ssl_ctx, const struct login_settings *set,
+ bool load_xnames)
{
X509_STORE *store;
STACK_OF(X509_NAME) *xnames = NULL;
@@ -956,7 +957,7 @@
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS);
#endif
- if (*set->ssl_ca != '\0') {
+ if (*set->ssl_ca != '\0' && load_xnames) {
/* set trusted CA certs */
store = SSL_CTX_get_cert_store(ssl_ctx);
xnames = load_ca(store, set->ssl_ca);
@@ -1198,7 +1199,7 @@
ctx->ctx = ssl_ctx = SSL_CTX_new(SSLv23_server_method());
if (ssl_ctx == NULL)
i_fatal("SSL_CTX_new() failed");
- xnames = ssl_proxy_ctx_init(ssl_ctx, set);
+ xnames = ssl_proxy_ctx_init(ssl_ctx, set, ctx->verify_client_cert);
if (SSL_CTX_set_cipher_list(ssl_ctx, ctx->cipher_list) != 1) {
i_fatal("Can't set cipher list to '%s': %s",
@@ -1265,7 +1266,7 @@
if ((ssl_client_ctx = SSL_CTX_new(SSLv23_client_method())) == NULL)
i_fatal("SSL_CTX_new() failed");
- xnames = ssl_proxy_ctx_init(ssl_client_ctx, set);
+ xnames = ssl_proxy_ctx_init(ssl_client_ctx, set, TRUE);
ssl_proxy_ctx_verify_client(ssl_client_ctx, xnames);
ssl_proxy_client_ctx_set_client_cert(ssl_client_ctx, set);
diff -r 9cc178c7afb3 -r 584bd77c38fd src/plugins/quota/quota.c
--- a/src/plugins/quota/quota.c Wed Apr 11 18:23:34 2012 +0300
+++ b/src/plugins/quota/quota.c Wed Apr 11 19:06:44 2012 +0300
@@ -723,7 +723,7 @@
return -1;
warning = array_append_space(&root_set->warning_rules);
- warning->command = i_strdup(p+1);
+ warning->command = p_strdup(root_set->set->pool, p+1);
warning->rule = rule;
warning->reverse = reverse;
More information about the dovecot-cvs
mailing list