]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-client-command - Make smtp_client_command_unref(NULL) a no-op.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 9 Feb 2021 22:44:42 +0000 (23:44 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 10 Mar 2021 11:17:50 +0000 (11:17 +0000)
src/lib-smtp/smtp-client-command.c

index 326e1783627c9d8a669d27ab60c21ceaeab50cd8..014071c1ae01eb4d28ba6d43b839292cb0767a49 100644 (file)
@@ -115,6 +115,12 @@ void smtp_client_command_ref(struct smtp_client_command *cmd)
 void smtp_client_command_unref(struct smtp_client_command **_cmd)
 {
        struct smtp_client_command *cmd = *_cmd;
+
+       *_cmd = NULL;
+
+       if (cmd == NULL)
+               return;
+
        struct smtp_client_connection *conn = cmd->conn;
 
        i_assert(cmd->refcount > 0);