Skip to content

Commit

Permalink
global: Replace mail_storage_service_user_free() with _unref()
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Feb 22, 2017
1 parent 036e524 commit d5b9037
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-auth-server.c
Expand Up @@ -343,7 +343,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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-auth.c
Expand Up @@ -586,7 +586,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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-mail-copymove.c
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-mail-import.c
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/doveadm/doveadm-mail.c
Expand Up @@ -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;
}
}
Expand All @@ -401,15 +401,15 @@ doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx,
&ctx->cur_mail_user);
if (ret < 0) {
*error_r = "User init failed";
mail_storage_service_user_free(&ctx->cur_service_user);
mail_storage_service_user_unref(&ctx->cur_service_user);
return ret;
}

if (ctx->v.run(ctx, ctx->cur_mail_user) < 0) {
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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/imap-urlauth/imap-urlauth-worker.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/imap/imap-client.c
Expand Up @@ -467,7 +467,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);
Expand Down
2 changes: 1 addition & 1 deletion src/imap/main.c
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/indexer/master-connection.c
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/lda/main.c
Expand Up @@ -491,7 +491,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;
Expand Down
2 changes: 1 addition & 1 deletion src/lmtp/client.c
Expand Up @@ -366,7 +366,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);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/lmtp/commands.c
Expand Up @@ -604,7 +604,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);
Expand All @@ -630,7 +630,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);
Expand Down Expand Up @@ -728,7 +728,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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/mail-crypt/doveadm-mail-crypt.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/mail-crypt/mail-crypt-acl-plugin.c
Expand Up @@ -304,7 +304,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);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/mail-crypt/test-mail-key.c
Expand Up @@ -192,7 +192,7 @@ static
void deinit_test_mail_user()
{
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) < 0)
i_error("unlink_directory(%s) failed", mail_home);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/quota/quota-status.c
Expand Up @@ -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);
}
if (ret < 0) {
/* temporary failure */
Expand Down
2 changes: 1 addition & 1 deletion src/pop3/pop3-client.c
Expand Up @@ -643,7 +643,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);
Expand Down

0 comments on commit d5b9037

Please sign in to comment.