Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/imap/cmd-x-cancel.c @ 7431:33d8adcc2d44 HEAD
client_command_free()/cancel(): Take pointer-to-pointer parameter and set it
to NULL to make sure it's not accessed again.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 20 Mar 2008 16:26:27 +0200 |
parents | 7ed926ed7aa4 |
children | b9faf4db2a9f |
rev | line source |
---|---|
7086
7ed926ed7aa4
Updated copyright notices to include year 2008.
Timo Sirainen <tss@iki.fi>
parents:
6429
diff
changeset
|
1 /* Copyright (c) 2006-2008 Dovecot authors, see the included COPYING file */ |
4943 | 2 |
3 #include "common.h" | |
4 #include "commands.h" | |
5 | |
6 bool cmd_x_cancel(struct client_command_context *cmd) | |
7 { | |
8 struct client_command_context *cancel_cmd; | |
9 const char *tag; | |
10 | |
11 /* <tag> */ | |
12 if (!client_read_string_args(cmd, 1, &tag)) | |
13 return FALSE; | |
14 | |
15 cancel_cmd = cmd->client->command_queue; | |
16 for (; cancel_cmd != NULL; cancel_cmd = cancel_cmd->next) { | |
17 if (cancel_cmd->tag != NULL && cancel_cmd != cmd && | |
18 strcmp(cancel_cmd->tag, tag) == 0) { | |
7431
33d8adcc2d44
client_command_free()/cancel(): Take pointer-to-pointer parameter and set it
Timo Sirainen <tss@iki.fi>
parents:
7086
diff
changeset
|
19 client_command_cancel(&cancel_cmd); |
4943 | 20 client_send_tagline(cmd, "OK Command cancelled."); |
21 return TRUE; | |
22 } | |
23 } | |
24 | |
25 client_send_tagline(cmd, "NO Command tag not found."); | |
26 return TRUE; | |
27 } | |
28 |