From: Timo Sirainen Date: Tue, 24 Nov 2015 10:56:35 +0000 (+0200) Subject: imap: Fixed crash at FETCH deinit caused by b638e19d3bd4 X-Git-Tag: 2.2.20.rc1~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=952148e3d09fc29992f1b509b5fa4fdadb80755e;p=thirdparty%2Fdovecot%2Fcore.git imap: Fixed crash at FETCH deinit caused by b638e19d3bd4 imap_fetch_free() would have been called twice, which caused problems. --- diff --git a/src/imap/cmd-fetch.c b/src/imap/cmd-fetch.c index d19eaf3233..82d3ccc35d 100644 --- a/src/imap/cmd-fetch.c +++ b/src/imap/cmd-fetch.c @@ -172,6 +172,11 @@ fetch_parse_modifiers(struct imap_fetch_context *ctx, return TRUE; } +static bool cmd_fetch_finished(struct client_command_context *cmd ATTR_UNUSED) +{ + return TRUE; +} + static bool cmd_fetch_finish(struct imap_fetch_context *ctx, struct client_command_context *cmd) { @@ -199,6 +204,7 @@ static bool cmd_fetch_finish(struct imap_fetch_context *ctx, output bytes are included in it (which wouldn't happen if we called client_disconnect() here directly). */ + cmd->func = cmd_fetch_finished; return cmd->cancel; }