]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib_deinit() now frees memory used by env_put().
authorTimo Sirainen <tss@iki.fi>
Sun, 2 Aug 2009 17:53:32 +0000 (13:53 -0400)
committerTimo Sirainen <tss@iki.fi>
Sun, 2 Aug 2009 17:53:32 +0000 (13:53 -0400)
--HG--
branch : HEAD

src/lib/env-util.c
src/lib/env-util.h
src/lib/lib.c

index 3637c3e558201063458633c140fb3bb12222c8a7..6c9548046cf2c8aa7479b1a44f604cbe977be6db 100644 (file)
@@ -99,3 +99,9 @@ void env_backup_free(struct env_backup **_env)
        *_env = NULL;
        pool_unref(&env->pool);
 }
+
+void env_deinit(void)
+{
+       if (env_pool != NULL)
+               pool_unref(&env_pool);
+}
index aed153906bf5384e2f9a962970666f8888b9c697..44107f8ed5bab32af05a260aed5f27803e527634 100644 (file)
@@ -16,4 +16,8 @@ void env_backup_restore(struct env_backup *env);
 /* 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
index 0380a42ade8adf730bbb3fd0797417b4af1b1c39..8d7d54a1a26fa5d778534e93693d038063578962 100644 (file)
@@ -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_init(void)
 void lib_deinit(void)
 {
        data_stack_deinit();
-        failures_deinit();
+       env_deinit();
+       failures_deinit();
 }