]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Fixed assert-crash on anvil lookup failures.
authorTimo Sirainen <tss@iki.fi>
Wed, 10 Jun 2015 17:29:35 +0000 (20:29 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 10 Jun 2015 17:29:35 +0000 (20:29 +0300)
If anvil_client_query() fails, it immediately calls the callback and returns
NULL. So we need to increase anvil_queries even before calling
anvil_client_query()

src/lmtp/commands.c

index f22991d82121d539579c1b9a4c0c58bfe61fb2f4..b36503b0b7defa14c5a253326330043edbf45231 100644 (file)
@@ -693,10 +693,9 @@ int cmd_rcpt(struct client *client, const char *args)
                        master_service_get_name(master_service),
                        "/", str_tabescape(username), NULL);
                lmtp_anvil_init();
+               client->state.anvil_queries++;
                rcpt->anvil_query = anvil_client_query(anvil, query,
                                        rcpt_anvil_lookup_callback, rcpt);
-               if (rcpt->anvil_query != NULL)
-                       client->state.anvil_queries++;
        }
        return 0;
 }