]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Restructure reference counting of BDAT/BURL chain stream.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 19 Jun 2018 22:31:43 +0000 (00:31 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 26 Jun 2018 19:12:58 +0000 (19:12 +0000)
It is now dereferenced directly, rather than via a local variable; thereby
making sure it is reset to NULL.

src/lib-smtp/smtp-server-cmd-data.c

index f2ed0609d1cb8c2db0db8a0aa90d383075959c47..7775310f55e5e4d2b9116d9c7a549b391d6d5b1b 100644 (file)
@@ -523,7 +523,6 @@ int smtp_server_connection_data_chunk_add(struct smtp_server_cmd_ctx *cmd,
        struct smtp_server_command *command = cmd->cmd;
        struct cmd_data_context *data_cmd =
                (struct cmd_data_context *)command->data;
-       struct istream *input;
        uoff_t new_size;
 
        i_assert(data_cmd != NULL);
@@ -549,9 +548,8 @@ int smtp_server_connection_data_chunk_add(struct smtp_server_cmd_ctx *cmd,
        data_cmd->client_input = client_input;
        i_stream_ref(chunk);
 
-       input = (data_cmd->chunk_first ? conn->state.data_chain_input : NULL);
-       cmd_data_start_input(cmd, input);
-       i_stream_unref(&input);
+       cmd_data_start_input(cmd, conn->state.data_chain_input);
+       i_stream_unref(&conn->state.data_chain_input);
        return 0;
 }