Skip to content

Commit

Permalink
managesieve: Free mail_user only after client is disconnected.
Browse files Browse the repository at this point in the history
Mimics Dovecot/IMAP change 1001bda65e9f592d852a26ddd6a993f7973050bf.
  • Loading branch information
stephanbosch committed Jun 23, 2016
1 parent 16f16bd commit 8918308
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/managesieve/managesieve-client.c
Expand Up @@ -256,7 +256,6 @@ void client_destroy(struct client *client, const char *reason)
mail_user_get_anvil_userip_ident(client->user),
"\n", NULL));
}
mail_user_unref(&client->user);

managesieve_parser_destroy(&client->parser);
if (client->io != NULL)
Expand All @@ -272,6 +271,10 @@ void client_destroy(struct client *client, const char *reason)
if (client->fd_in != client->fd_out)
net_disconnect(client->fd_out);

/* Free the user after client is already disconnected. It may start
some background work like autoexpunging. */
mail_user_unref(&client->user);

sieve_storage_unref(&client->storage);
sieve_deinit(&client->svinst);

Expand Down

0 comments on commit 8918308

Please sign in to comment.