Skip to content

Commit d37c682

Browse files
committed
calls to array_idx_modifiable that require space allocation changed to array_idx_get_space
1 parent 7aad88b commit d37c682

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/client-state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ bool imap_client_get_random_seq_range(struct imap_client *client,
10021002
msgs = array_count(&client->view->uidmap);
10031003
for (i = tries = 0; i < count && tries < count*3; tries++) {
10041004
seq = i_rand() % msgs + 1;
1005-
metadata = array_idx_modifiable(&client->view->messages,
1005+
metadata = array_idx_get_space(&client->view->messages,
10061006
seq - 1);
10071007
owner = metadata->ms == NULL ? 0 :
10081008
metadata->ms->owner_client_idx1;

src/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ struct client *client_new_user(struct user *user)
187187
if (!user_get_new_client_profile(user, &uc))
188188
return NULL;
189189
while (client_min_free_idx < conf.clients_count) {
190-
clientp = array_idx_modifiable(&clients, client_min_free_idx);
190+
clientp = array_idx_get_space(&clients, client_min_free_idx);
191191
if (*clientp == NULL)
192192
return client_new_full(client_min_free_idx, user, uc);
193193
client_min_free_idx++;

src/imap-client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int imap_client_expunge(struct imap_client *client, unsigned int seq)
100100
return -1;
101101
}
102102

103-
metadata = array_idx_modifiable(&client->view->messages, seq - 1);
103+
metadata = array_idx_get_space(&client->view->messages, seq - 1);
104104
if (metadata->fetch_refcount > 0) {
105105
imap_client_input_error(client,
106106
"Referenced message expunged seq=%u uid=%u",

src/mailbox-state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ void mailbox_state_handle_fetch(struct imap_client *client, unsigned int seq,
519519
}
520520
uid = *uidp;
521521

522-
metadata = array_idx_modifiable(&view->messages, seq - 1);
522+
metadata = array_idx_get_space(&view->messages, seq - 1);
523523
if (metadata->ms == NULL && uid != 0) {
524524
metadata->ms =
525525
message_metadata_static_get(client->storage, uid);

src/test-exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ test_handle_untagged_match(struct imap_client *client, const struct imap_arg *ar
602602
array_clear(&ctx->added_variables);
603603
found = buffer_get_space_unsafe(ctx->cur_received_untagged, 0, count);
604604
if (count > 0)
605-
(void)array_idx_modifiable(&ctx->cur_maybe_matches, count-1);
606-
maybes = array_idx_modifiable(&ctx->cur_maybe_matches, 0);
605+
(void)array_idx_get_space(&ctx->cur_maybe_matches, count-1);
606+
maybes = array_idx_get_space(&ctx->cur_maybe_matches, 0);
607607
found_some = FALSE;
608608
for (i = 0; i < count; i++) {
609609
if (found[i] != 0)

src/test-parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test_parse_header_line(struct test_parser *parser, struct test *test,
6565
test->require_user2 = TRUE;
6666
value = conf.username2_template;
6767
}
68-
test_conn = array_idx_modifiable(&test->connections, idx-1);
68+
test_conn = array_idx_get_space(&test->connections, idx-1);
6969
test_conn->username = p_strdup(parser->pool, value);
7070
return TRUE;
7171
}

0 commit comments

Comments
 (0)