[dovecot-cvs] dovecot/src/imap cmd-idle.c,1.36,1.37

tss at dovecot.org tss at dovecot.org
Mon Mar 26 19:59:08 EEST 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv4672

Modified Files:
	cmd-idle.c 
Log Message:
crashfix



Index: cmd-idle.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-idle.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- cmd-idle.c	6 Feb 2007 12:56:13 -0000	1.36
+++ cmd-idle.c	26 Mar 2007 16:59:06 -0000	1.37
@@ -29,7 +29,8 @@
 
 static bool cmd_idle_continue(struct client_command_context *cmd);
 
-static void idle_finish(struct cmd_idle_context *ctx, bool done_ok)
+static void
+idle_finish(struct cmd_idle_context *ctx, bool done_ok, bool free_cmd)
 {
 	struct client *client = ctx->client;
 
@@ -62,7 +63,8 @@
 		client_send_tagline(ctx->cmd, "BAD Expected DONE.");
 
 	o_stream_uncork(client->output);
-	client_command_free(ctx->cmd);
+	if (free_cmd)
+		client_command_free(ctx->cmd);
 	client_continue_pending_input(client);
 }
 
@@ -80,7 +82,7 @@
 		return;
 	case -2:
 		client->input_skip_line = TRUE;
-		idle_finish(ctx, FALSE);
+		idle_finish(ctx, FALSE, TRUE);
 		return;
 	}
 
@@ -95,7 +97,7 @@
 		if (client->input_skip_line)
 			client->input_skip_line = FALSE;
 		else {
-			idle_finish(ctx, strcmp(line, "DONE") == 0);
+			idle_finish(ctx, strcmp(line, "DONE") == 0, TRUE);
 			break;
 		}
 	}
@@ -163,7 +165,7 @@
 	struct cmd_idle_context *ctx = cmd->context;
 
 	if (cmd->cancel) {
-		idle_finish(ctx, FALSE);
+		idle_finish(ctx, FALSE, FALSE);
 		return TRUE;
 	}
 
@@ -211,7 +213,7 @@
 	}
 
 	if (client->output->closed) {
-		idle_finish(ctx, FALSE);
+		idle_finish(ctx, FALSE, FALSE);
 		return TRUE;
 	}
 	if (client->io == NULL) {



More information about the dovecot-cvs mailing list