From: Timo Sirainen Date: Tue, 12 Aug 2008 21:27:26 +0000 (-0400) Subject: Master process leaked one fd to login process. Typically it was listener fd, X-Git-Tag: 1.2.alpha1~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b4d56baa72a3882712660b0668d8d66f5344559;p=thirdparty%2Fdovecot%2Fcore.git Master process leaked one fd to login process. Typically it was listener fd, which caused imap-login processes existing after Dovecot was killed to keep the port reserved so Dovecot couldn't be started again. --HG-- branch : HEAD --- diff --git a/src/login-common/main.c b/src/login-common/main.c index 97f019d267..2a7fee4415 100644 --- a/src/login-common/main.c +++ b/src/login-common/main.c @@ -404,7 +404,7 @@ int main(int argc ATTR_UNUSED, char *argv[], char *envp[]) env = getenv("SSL_LISTEN_FDS"); if (env != NULL) i += atoi(env); - fd_debug_verify_leaks(i + 1, 1024); + fd_debug_verify_leaks(i, 1024); } #endif /* clear all allocated memory before freeing it. this makes the login diff --git a/src/master/login-process.c b/src/master/login-process.c index 69021d5251..7d529a1112 100644 --- a/src/master/login-process.c +++ b/src/master/login-process.c @@ -691,7 +691,7 @@ static pid_t create_login_process(struct login_group *group) i_fatal("Failed to dup2() fds"); /* don't close any of these */ - for (tmp_fd = 0; tmp_fd <= cur_fd; tmp_fd++) + for (tmp_fd = 0; tmp_fd < cur_fd; tmp_fd++) fd_close_on_exec(tmp_fd, FALSE); (void)close(fd[0]);