]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed crash at FETCH deinit caused by b638e19d3bd4
authorTimo Sirainen <tss@iki.fi>
Tue, 24 Nov 2015 10:56:35 +0000 (12:56 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 24 Nov 2015 10:56:35 +0000 (12:56 +0200)
imap_fetch_free() would have been called twice, which caused problems.

src/imap/cmd-fetch.c

index d19eaf3233294075ecff67ee7515066dea3ac35e..82d3ccc35ded4448fbe8dce70172f0632afab262 100644 (file)
@@ -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;
                }