]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-client-command - Always use smtp_client_command_drop_callback() to...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 21 Jun 2025 16:09:22 +0000 (18:09 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Sun, 29 Jun 2025 17:22:15 +0000 (17:22 +0000)
For consistency.

src/lib-smtp/smtp-client-command.c

index f4f17f1d4d66c1b6afa9f0d6438d7e0a9590065c..5b763a7a10cccf30273b08af75be983681afad98 100644 (file)
@@ -304,6 +304,7 @@ void smtp_client_command_fail_reply(struct smtp_client_command **_cmd,
        struct smtp_client_connection *conn = cmd->conn;
        enum smtp_client_command_state state = cmd->state;
        smtp_client_command_callback_t *callback = cmd->callback;
+       void *context = cmd->context;
 
        if (state >= SMTP_CLIENT_COMMAND_STATE_FINISHED)
                return;
@@ -324,8 +325,7 @@ void smtp_client_command_fail_reply(struct smtp_client_command **_cmd,
                return;
        }
 
-       cmd->callback = NULL;
-
+       smtp_client_command_drop_callback(cmd);
        smtp_client_connection_ref(conn);
        smtp_client_command_ref(cmd);
 
@@ -342,7 +342,7 @@ void smtp_client_command_fail_reply(struct smtp_client_command **_cmd,
                e_debug(e->event(), "Failed: %s", smtp_reply_log(reply));
 
                if (callback != NULL)
-                       (void)callback(reply, cmd->context);
+                       (void)callback(reply, context);
        }
 
        tmp_cmd = cmd;