[dovecot-cvs] dovecot/src/imap imap-fetch.c,1.3,1.4

cras at procontrol.fi cras at procontrol.fi
Tue Jan 21 08:46:10 EET 2003


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv2189

Modified Files:
	imap-fetch.c 
Log Message:
Now it actually leaked memory..



Index: imap-fetch.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/imap-fetch.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- imap-fetch.c	21 Jan 2003 06:42:32 -0000	1.3
+++ imap-fetch.c	21 Jan 2003 06:46:08 -0000	1.4
@@ -270,7 +270,6 @@
 	ctx.bodies = bodies;
 	ctx.output = client->output;
 	ctx.select_counter = client->select_counter;
-	ctx.str = str_new(default_pool, 8192);
 
 	ctx.fetch_ctx = client->mailbox->
 		fetch_init(client->mailbox, fetch_data, &update_seen,
@@ -278,12 +277,14 @@
 	if (ctx.fetch_ctx == NULL)
 		return -1;
 
+	ctx.str = str_new(default_pool, 8192);
 	while ((mail = client->mailbox->fetch_next(ctx.fetch_ctx)) != NULL) {
 		if (!fetch_mail(&ctx, mail)) {
 			ctx.failed = TRUE;
 			break;
 		}
 	}
+	str_free(ctx.str);
 
 	if (!client->mailbox->fetch_deinit(ctx.fetch_ctx, &all_found))
 		return -1;




More information about the dovecot-cvs mailing list