From: Timo Sirainen Date: Mon, 9 Jun 2008 16:05:29 +0000 (+0300) Subject: env_clean(): Don't free environment memory pool to make sure the environment X-Git-Tag: 1.2.alpha1~358 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64e846e0d7288a7f62198d0b46d0661a0630e1e3;p=thirdparty%2Fdovecot%2Fcore.git env_clean(): Don't free environment memory pool to make sure the environment won't get corrupted in case the clearing fails. --HG-- branch : HEAD --- diff --git a/src/lib/env-util.c b/src/lib/env-util.c index 708709b216..e1bc683541 100644 --- a/src/lib/env-util.c +++ b/src/lib/env-util.c @@ -21,9 +21,12 @@ void env_clean(void) { extern char **environ; + /* Try to clear the environment. It should always be non-NULL, but + apparently it's not on some ancient OSes (Ultrix), so just keep + the check. The clearing also fails on FreeBSD 7.0 (currently). */ if (environ != NULL) *environ = NULL; - if (pool != NULL) - pool_unref(&pool); + /* don't clear the env_pool, otherwise the environment would get + corrupted if we failed to clear it. */ }