dovecot-1.2-sieve: Fixed a few memleaks caused by previous chang...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Mon Jan 11 20:03:43 EET 2010
details: http://hg.rename-it.nl/dovecot-1.2-sieve/rev/b6c5359c5c6f
changeset: 1197:b6c5359c5c6f
user: Stephan Bosch <stephan at rename-it.nl>
date: Mon Jan 11 19:03:37 2010 +0100
description:
Fixed a few memleaks caused by previous changes in error handling.
diffstat:
src/lib-sieve/plugins/enotify/cmd-notify.c | 2 ++
src/lib-sieve/sieve-result.c | 13 ++++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diffs (63 lines):
diff -r 54c3f6cce8de -r b6c5359c5c6f src/lib-sieve/plugins/enotify/cmd-notify.c
--- a/src/lib-sieve/plugins/enotify/cmd-notify.c Sun Jan 10 03:00:42 2010 +0100
+++ b/src/lib-sieve/plugins/enotify/cmd-notify.c Mon Jan 11 19:03:37 2010 +0100
@@ -604,6 +604,8 @@
(aenv->ehandler, action->location, "notify action");
result = method->def->action_execute(&nenv, act);
+
+ sieve_error_handler_unref(&nenv.ehandler);
}
return result;
diff -r 54c3f6cce8de -r b6c5359c5c6f src/lib-sieve/sieve-result.c
--- a/src/lib-sieve/sieve-result.c Sun Jan 10 03:00:42 2010 +0100
+++ b/src/lib-sieve/sieve-result.c Mon Jan 11 19:03:37 2010 +0100
@@ -144,6 +144,9 @@
if ( (*result)->ehandler != NULL )
sieve_error_handler_unref(&(*result)->ehandler);
+ if ( (*result)->action_env.ehandler != NULL )
+ sieve_error_handler_unref(&(*result)->action_env.ehandler);
+
pool_unref(&(*result)->pool);
*result = NULL;
@@ -854,7 +857,7 @@
NULL : t_strconcat(addr->mailbox, "@", addr->domain, NULL);
}
-static void _sieve_result_prepare_environment(struct sieve_result *result)
+static void _sieve_result_prepare_execution(struct sieve_result *result)
{
const struct sieve_message_data *msgdata = result->action_env.msgdata;
const struct sieve_script_env *senv = result->action_env.scriptenv;
@@ -886,6 +889,10 @@
result->action_env.exec_status =
( senv->exec_status == NULL ?
t_new(struct sieve_exec_status, 1) : senv->exec_status );
+
+ if ( result->action_env.ehandler != NULL )
+ sieve_error_handler_unref(&result->action_env.ehandler);
+
result->action_env.ehandler = sieve_varexpand_ehandler_create
(result->ehandler, senv->action_log_format, tab);
}
@@ -996,7 +1003,7 @@
bool sieve_result_implicit_keep
(struct sieve_result *result)
{
- _sieve_result_prepare_environment(result);
+ _sieve_result_prepare_execution(result);
return _sieve_result_implicit_keep(result, TRUE);
}
@@ -1030,7 +1037,7 @@
/* Prepare environment */
- _sieve_result_prepare_environment(result);
+ _sieve_result_prepare_execution(result);
/* Make notice of this attempt */
More information about the dovecot-cvs
mailing list