]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: client_unref() - always set client pointer to NULL
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 1 Nov 2017 19:44:54 +0000 (21:44 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Thu, 2 Nov 2017 12:32:23 +0000 (14:32 +0200)
This is the common coding practise elsewhere as well.

src/login-common/client-common.c

index 9d9c230c12968ab219691315cd9baa02ac598f71..7d3a85246b6e1a6f653dfb8ff1dbcff2fd079497 100644 (file)
@@ -326,12 +326,12 @@ bool client_unref(struct client **_client)
 {
        struct client *client = *_client;
 
+       *_client = NULL;
+
        i_assert(client->refcount > 0);
        if (--client->refcount > 0)
                return TRUE;
 
-       *_client = NULL;
-
        i_assert(client->destroyed);
        i_assert(client->login_proxy == NULL);