dovecot: Error handling fix.

dovecot at dovecot.org dovecot at dovecot.org
Thu Oct 25 21:04:31 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/63b4e1932a89
changeset: 6615:63b4e1932a89
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 25 21:04:27 2007 +0300
description:
Error handling fix.

diffstat:

1 file changed, 3 insertions(+), 2 deletions(-)
src/plugins/zlib/zlib-plugin.c |    5 +++--

diffs (23 lines):

diff -r ab3d8fba6420 -r 63b4e1932a89 src/plugins/zlib/zlib-plugin.c
--- a/src/plugins/zlib/zlib-plugin.c	Thu Oct 25 20:55:31 2007 +0300
+++ b/src/plugins/zlib/zlib-plugin.c	Thu Oct 25 21:04:27 2007 +0300
@@ -47,16 +47,17 @@ static int zlib_maildir_get_stream(struc
 
 	if (zmail->super.get_stream(_mail, NULL, NULL, &input) < 0)
 		return -1;
+	i_assert(input == imail->data.stream);
 
 	fname = maildir_uidlist_lookup(mbox->uidlist, _mail->uid, &flags);
 	i_assert(fname != NULL);
 	p = strstr(fname, ":2,");
 	if (p != NULL && strchr(p + 3, 'Z') != NULL) {
 		/* has a Z flag - it's compressed */
-		fd = dup(i_stream_get_fd(input));
+		fd = dup(i_stream_get_fd(imail->data.stream));
 		if (fd == -1)
 			i_error("zlib plugin: dup() failed: %m");
-		i_stream_unref(&input);
+		i_stream_unref(&imail->data.stream);
 
 		if (fd == -1)
 			return -1;


More information about the dovecot-cvs mailing list