From: Timo Sirainen Date: Wed, 22 Feb 2017 11:30:00 +0000 (+0200) Subject: global: Replace mail_storage_service_user_free() with _unref() X-Git-Tag: 2.3.0.rc1~2017 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb318ea05532d2e54ed3bfc89bc15dcf1adae838;p=thirdparty%2Fdovecot%2Fcore.git global: Replace mail_storage_service_user_free() with _unref() --- diff --git a/src/doveadm/doveadm-auth-server.c b/src/doveadm/doveadm-auth-server.c index b27486b99c..2549208409 100644 --- a/src/doveadm/doveadm-auth-server.c +++ b/src/doveadm/doveadm-auth-server.c @@ -351,7 +351,7 @@ cmd_user_mail_input(struct mail_storage_service_ctx *storage_service, } mail_user_unref(&user); - mail_storage_service_user_free(&service_user); + mail_storage_service_user_unref(&service_user); pool_unref(&pool); return 1; } diff --git a/src/doveadm/doveadm-auth.c b/src/doveadm/doveadm-auth.c index 4747fb3fd0..130a109ea8 100644 --- a/src/doveadm/doveadm-auth.c +++ b/src/doveadm/doveadm-auth.c @@ -590,7 +590,7 @@ cmd_user_mail_input(struct mail_storage_service_ctx *storage_service, } mail_user_unref(&user); - mail_storage_service_user_free(&service_user); + mail_storage_service_user_unref(&service_user); pool_unref(&pool); return 1; } diff --git a/src/doveadm/doveadm-mail-copymove.c b/src/doveadm/doveadm-mail-copymove.c index dee73f2c6b..2cc2f5b6e7 100644 --- a/src/doveadm/doveadm-mail-copymove.c +++ b/src/doveadm/doveadm-mail-copymove.c @@ -165,7 +165,7 @@ static void cmd_copy_deinit(struct doveadm_mail_cmd_context *_ctx) struct copy_cmd_context *ctx = (struct copy_cmd_context *)_ctx; if (ctx->source_user != NULL) { - mail_storage_service_user_free(&ctx->source_service_user); + mail_storage_service_user_unref(&ctx->source_service_user); mail_user_unref(&ctx->source_user); } } diff --git a/src/doveadm/doveadm-mail-import.c b/src/doveadm/doveadm-mail-import.c index 9235046bb7..50d13b657a 100644 --- a/src/doveadm/doveadm-mail-import.c +++ b/src/doveadm/doveadm-mail-import.c @@ -177,7 +177,7 @@ static void cmd_import_init_source_user(struct import_cmd_context *ctx, struct m i_fatal("Import namespace initialization failed: %s", error); ctx->src_user = user; - mail_storage_service_user_free(&service_user); + mail_storage_service_user_unref(&service_user); } static int diff --git a/src/doveadm/doveadm-mail.c b/src/doveadm/doveadm-mail.c index 0fd7f998bb..c0b9e6be12 100644 --- a/src/doveadm/doveadm-mail.c +++ b/src/doveadm/doveadm-mail.c @@ -391,7 +391,7 @@ doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx, if (ctx->v.prerun != NULL) { if (ctx->v.prerun(ctx, ctx->cur_service_user, error_r) < 0) { - mail_storage_service_user_free(&ctx->cur_service_user); + mail_storage_service_user_unref(&ctx->cur_service_user); return -1; } } @@ -400,7 +400,7 @@ doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx, ctx->cur_service_user, &ctx->cur_mail_user, error_r); if (ret < 0) { - mail_storage_service_user_free(&ctx->cur_service_user); + mail_storage_service_user_unref(&ctx->cur_service_user); return ret; } @@ -408,7 +408,7 @@ doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx, i_assert(ctx->exit_code != 0); } mail_user_unref(&ctx->cur_mail_user); - mail_storage_service_user_free(&ctx->cur_service_user); + mail_storage_service_user_unref(&ctx->cur_service_user); return 1; } diff --git a/src/imap-urlauth/imap-urlauth-worker.c b/src/imap-urlauth/imap-urlauth-worker.c index ed0470ade7..a3c9e8938f 100644 --- a/src/imap-urlauth/imap-urlauth-worker.c +++ b/src/imap-urlauth/imap-urlauth-worker.c @@ -260,7 +260,7 @@ static void client_destroy(struct client *client) net_disconnect(client->fd_ctrl); if (client->service_user != NULL) - mail_storage_service_user_free(&client->service_user); + mail_storage_service_user_unref(&client->service_user); i_free(client->access_user); array_foreach_modifiable(&client->access_apps, app) i_free(*app); diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 83a2fa5ae7..b99fc5ad0f 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -462,7 +462,7 @@ static void client_default_destroy(struct client *client, const char *reason) if (array_is_created(&client->search_updates)) array_free(&client->search_updates); pool_unref(&client->command_pool); - mail_storage_service_user_free(&client->service_user); + mail_storage_service_user_unref(&client->service_user); imap_client_count--; DLLIST_REMOVE(&imap_clients, client); diff --git a/src/imap/main.c b/src/imap/main.c index 6ef5f6edaf..eaf7ff5ae3 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -242,7 +242,7 @@ int client_create_from_input(const struct mail_storage_service_input *input, if (mail_error != MAIL_ERROR_NONE) { *error_r = t_strdup(errstr); mail_user_unref(&mail_user); - mail_storage_service_user_free(&user); + mail_storage_service_user_unref(&user); return -1; } @@ -259,7 +259,7 @@ int client_create_from_input(const struct mail_storage_service_input *input, &errstr) <= 0) { *error_r = t_strdup_printf("Failed to expand settings: %s", errstr); mail_user_unref(&mail_user); - mail_storage_service_user_free(&user); + mail_storage_service_user_unref(&user); return -1; } diff --git a/src/indexer/master-connection.c b/src/indexer/master-connection.c index d1cbd193db..680d6bc13a 100644 --- a/src/indexer/master-connection.c +++ b/src/indexer/master-connection.c @@ -229,7 +229,7 @@ master_connection_input_line(struct master_connection *conn, const char *line) max_recent_msgs, args[4]); indexer_worker_refresh_proctitle(NULL, NULL, 0, 0); mail_user_unref(&user); - mail_storage_service_user_free(&service_user); + mail_storage_service_user_unref(&service_user); } str = ret < 0 ? "-1\n" : "100\n"; diff --git a/src/lda/main.c b/src/lda/main.c index 01ef837dca..3163d24851 100644 --- a/src/lda/main.c +++ b/src/lda/main.c @@ -497,7 +497,7 @@ int main(int argc, char *argv[]) mail_user_unref(&ctx.dest_user); mail_deliver_session_deinit(&ctx.session); - mail_storage_service_user_free(&service_user); + mail_storage_service_user_unref(&service_user); mail_storage_service_deinit(&storage_service); master_service_deinit(&master_service); return EX_OK; diff --git a/src/lmtp/client.c b/src/lmtp/client.c index 1dc0b96594..ad29a3971f 100644 --- a/src/lmtp/client.c +++ b/src/lmtp/client.c @@ -369,7 +369,7 @@ void client_state_reset(struct client *client, const char *state_name) if ((*rcptp)->anvil_query != NULL) anvil_client_query_abort(anvil, &(*rcptp)->anvil_query); client_rcpt_anvil_disconnect(*rcptp); - mail_storage_service_user_free(&(*rcptp)->service_user); + mail_storage_service_user_unref(&(*rcptp)->service_user); } } diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index 2d900c89da..e87e195d27 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -614,7 +614,7 @@ static bool cmd_rcpt_finish(struct client *client, struct mail_recipient *rcpt) client_send_line(client, ERRSTR_TEMP_MAILBOX_FAIL, rcpt->address); } - mail_storage_service_user_free(&rcpt->service_user); + mail_storage_service_user_unref(&rcpt->service_user); return FALSE; } array_append(&client->state.rcpt_to, &rcpt, 1); @@ -640,7 +640,7 @@ static void rcpt_anvil_lookup_callback(const char *reply, void *context) client_send_line(client, ERRSTR_TEMP_USERDB_FAIL_PREFIX "Too many concurrent deliveries for user", rcpt->address); - mail_storage_service_user_free(&rcpt->service_user); + mail_storage_service_user_unref(&rcpt->service_user); } else if (cmd_rcpt_finish(client, rcpt)) { rcpt->anvil_connect_sent = TRUE; input = mail_storage_service_user_get_input(rcpt->service_user); @@ -738,7 +738,7 @@ int cmd_rcpt(struct client *client, const char *args) client_send_line(client, "451 4.3.0 <%s> " "Can't handle mixed proxy/non-proxy destinations", address); - mail_storage_service_user_free(&rcpt->service_user); + mail_storage_service_user_unref(&rcpt->service_user); return 0; } diff --git a/src/plugins/mail-crypt/doveadm-mail-crypt.c b/src/plugins/mail-crypt/doveadm-mail-crypt.c index bfe31373ed..c02c5e7718 100644 --- a/src/plugins/mail-crypt/doveadm-mail-crypt.c +++ b/src/plugins/mail-crypt/doveadm-mail-crypt.c @@ -152,7 +152,7 @@ mcp_update_shared_key(struct mailbox_transaction_context *t, mail_storage_service_io_activate_user(dest_service_user); mail_user_unref(&dest_user); - mail_storage_service_user_free(&dest_service_user); + mail_storage_service_user_unref(&dest_service_user); if ((cur_ioloop_ctx = io_loop_get_current_context(current_ioloop)) != NULL) io_loop_context_deactivate(cur_ioloop_ctx); diff --git a/src/plugins/mail-crypt/mail-crypt-acl-plugin.c b/src/plugins/mail-crypt/mail-crypt-acl-plugin.c index ac62dc6f2d..c03fe707ca 100644 --- a/src/plugins/mail-crypt/mail-crypt-acl-plugin.c +++ b/src/plugins/mail-crypt/mail-crypt-acl-plugin.c @@ -317,7 +317,7 @@ static int mail_crypt_acl_object_update(struct acl_object *aclobj, mail_storage_service_io_activate_user(dest_service_user); mail_user_unref(&dest_user); - mail_storage_service_user_free(&dest_service_user); + mail_storage_service_user_unref(&dest_service_user); if ((cur_ioloop_ctx = io_loop_get_current_context(current_ioloop)) != NULL) io_loop_context_deactivate(cur_ioloop_ctx); diff --git a/src/plugins/mail-crypt/test-mail-key.c b/src/plugins/mail-crypt/test-mail-key.c index 5cb399cdd7..ea5d59f26d 100644 --- a/src/plugins/mail-crypt/test-mail-key.c +++ b/src/plugins/mail-crypt/test-mail-key.c @@ -188,7 +188,7 @@ void deinit_test_mail_user() { const char *error; mail_user_unref(&test_mail_user); - mail_storage_service_user_free(&test_service_user); + mail_storage_service_user_unref(&test_service_user); mail_storage_service_deinit(&mail_storage_service); if (unlink_directory(mail_home, UNLINK_DIRECTORY_FLAG_RMDIR, &error) < 0) diff --git a/src/plugins/quota/quota-status.c b/src/plugins/quota/quota-status.c index cafa9f48e0..46ff0a5880 100644 --- a/src/plugins/quota/quota-status.c +++ b/src/plugins/quota/quota-status.c @@ -116,7 +116,7 @@ static void client_handle_request(struct quota_client *client) } value = t_strdup(value); /* user's pool is being freed */ mail_user_unref(&user); - mail_storage_service_user_free(&service_user); + mail_storage_service_user_unref(&service_user); } else { i_error("Failed to lookup user %s: %s", input.username, error); error = "Temporary internal error"; diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index 2fe964959b..dc165003da 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -631,7 +631,7 @@ static void client_default_destroy(struct client *client, const char *reason) o_stream_destroy(&client->output); fd_close_maybe_stdio(&client->fd_in, &client->fd_out); - mail_storage_service_user_free(&client->service_user); + mail_storage_service_user_unref(&client->service_user); pop3_client_count--; DLLIST_REMOVE(&pop3_clients, client);