changeset 996:b26a06cd5e8f HEAD

Now it actually leaked memory..
author Timo Sirainen <tss@iki.fi>
date Tue, 21 Jan 2003 08:46:08 +0200
parents 4b264ea5d41d
children 6abffe419582
files src/imap/imap-fetch.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-fetch.c	Tue Jan 21 08:45:51 2003 +0200
+++ b/src/imap/imap-fetch.c	Tue Jan 21 08:46:08 2003 +0200
@@ -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;