dovecot-2.0: lib_deinit() now frees memory used by env_put().
dovecot at dovecot.org
dovecot at dovecot.org
Sun Aug 2 20:54:16 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/d48c8c0c1d29
changeset: 9712:d48c8c0c1d29
user: Timo Sirainen <tss at iki.fi>
date: Sun Aug 02 13:53:32 2009 -0400
description:
lib_deinit() now frees memory used by env_put().
diffstat:
3 files changed, 13 insertions(+), 1 deletion(-)
src/lib/env-util.c | 6 ++++++
src/lib/env-util.h | 4 ++++
src/lib/lib.c | 4 +++-
diffs (44 lines):
diff -r 140558f1987a -r d48c8c0c1d29 src/lib/env-util.c
--- a/src/lib/env-util.c Sun Aug 02 13:50:46 2009 -0400
+++ b/src/lib/env-util.c Sun Aug 02 13:53:32 2009 -0400
@@ -99,3 +99,9 @@ void env_backup_free(struct env_backup *
*_env = NULL;
pool_unref(&env->pool);
}
+
+void env_deinit(void)
+{
+ if (env_pool != NULL)
+ pool_unref(&env_pool);
+}
diff -r 140558f1987a -r d48c8c0c1d29 src/lib/env-util.h
--- a/src/lib/env-util.h Sun Aug 02 13:50:46 2009 -0400
+++ b/src/lib/env-util.h Sun Aug 02 13:53:32 2009 -0400
@@ -16,4 +16,8 @@ void env_backup_restore(struct env_backu
/* Free the memory used by environment backup. */
void env_backup_free(struct env_backup **env);
+/* Free all memory used by env_put() function. Environment must not be
+ accessed afterwards. */
+void env_deinit(void);
+
#endif
diff -r 140558f1987a -r d48c8c0c1d29 src/lib/lib.c
--- a/src/lib/lib.c Sun Aug 02 13:50:46 2009 -0400
+++ b/src/lib/lib.c Sun Aug 02 13:53:32 2009 -0400
@@ -1,6 +1,7 @@
/* Copyright (c) 2001-2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
+#include "env-util.h"
#include "hostpid.h"
#include <stdlib.h>
@@ -28,5 +29,6 @@ void lib_deinit(void)
void lib_deinit(void)
{
data_stack_deinit();
- failures_deinit();
+ env_deinit();
+ failures_deinit();
}
More information about the dovecot-cvs
mailing list