dovecot-2.2: fs-posix: Fixed memory leak in fs_iter_deinit()

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 13 19:16:23 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/73f806838456
changeset: 17795:73f806838456
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 13 22:14:09 2014 +0300
description:
fs-posix: Fixed memory leak in fs_iter_deinit()

diffstat:

 src/lib-fs/fs-posix.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r ccc5701dae72 -r 73f806838456 src/lib-fs/fs-posix.c
--- a/src/lib-fs/fs-posix.c	Fri Sep 12 12:55:12 2014 +0300
+++ b/src/lib-fs/fs-posix.c	Sat Sep 13 22:14:09 2014 +0300
@@ -734,6 +734,10 @@
 	struct posix_fs_iter *iter = (struct posix_fs_iter *)_iter;
 	int ret = 0;
 
+	if (closedir(iter->dir) < 0 && iter->err == 0) {
+		iter->err = errno;
+		fs_set_error(_iter->fs, "closedir(%s) failed: %m", iter->path);
+	}
 	if (iter->err != 0) {
 		errno = iter->err;
 		ret = -1;


More information about the dovecot-cvs mailing list