]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 25 Sep 2018 08:55:54 +0000 (11:55 +0300)
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 067d7ec96e4f983e534e5caefa09fc656f42887c..e2beff6b7f32fd206e948c81aba4bd3777ec5209 100644 (file)
@@ -501,7 +501,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);
@@ -527,9 +526,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;
 }