Found by latest clang scan-build.
{
struct db_ldap_result_iterate_context *ctx = context;
const char *field_name, *suffix;
- int ret;
suffix = strchr(t_strcut(data, ':'), '@');
- if ((ret = db_ldap_field_expand(data, ctx, &field_name, error_r)) <= 0)
+ if (db_ldap_field_expand(data, ctx, &field_name, error_r) <= 0)
i_unreached();
if (field_name[0] == '\0') {
*value_r = "";
struct dsync_mailbox_tree *orig_tree1, *orig_tree2;
struct dsync_mailbox_tree_sync_ctx *ctx;
struct dsync_mailbox_node *dup_node1, *dup_node2;
- const struct dsync_mailbox_tree_sync_change *change;
orig_tree1 = dsync_mailbox_tree_dup(tree1);
orig_tree2 = dsync_mailbox_tree_dup(tree2);
ctx = dsync_mailbox_trees_sync_init(tree1, tree2,
DSYNC_MAILBOX_TREES_SYNC_TYPE_TWOWAY,
DSYNC_MAILBOX_TREES_SYNC_FLAG_DEBUG);
- while ((change = dsync_mailbox_trees_sync_next(ctx)) != NULL) {
+ while (dsync_mailbox_trees_sync_next(ctx) != NULL) {
}
dsync_mailbox_trees_sync_deinit(&ctx);
test_tree_fixup(tree1);
dsync_mailbox_tree_build_guid_hash(orig_tree2, &dup_node1, &dup_node2);
ctx = dsync_mailbox_trees_sync_init(orig_tree2, orig_tree1,
DSYNC_MAILBOX_TREES_SYNC_TYPE_TWOWAY, 0);
- while ((change = dsync_mailbox_trees_sync_next(ctx)) != NULL) {
+ while (dsync_mailbox_trees_sync_next(ctx) != NULL) {
}
dsync_mailbox_trees_sync_deinit(&ctx);
test_tree_fixup(orig_tree1);
subscribe_is_valid_name(struct client_command_context *cmd, struct mailbox *box)
{
enum mailbox_existence existence;
- int ret;
- if ((ret = mailbox_exists(box, TRUE, &existence)) < 0) {
+ if (mailbox_exists(box, TRUE, &existence) < 0) {
client_send_box_error(cmd, box);
return FALSE;
}
return -1;
}
i_assert(ret == 1);
- if ((ret = write_full(fd_socket, str_data(cmd)+1, str_len(cmd)-1)) < 0) {
+ if (write_full(fd_socket, str_data(cmd)+1, str_len(cmd)-1) < 0) {
i_error("write(%s) failed: %m", path);
return -1;
}
unsigned char output_sha1[SHA1_RESULTLEN], input_sha1[SHA1_RESULTLEN];
const unsigned char *data;
size_t size;
- ssize_t ret;
handler = compression_lookup_handler_from_ext(out_path);
if (handler == NULL)
sha1_init(&sha1);
file_input = i_stream_create_fd(fd_out, IO_BLOCK_SIZE);
input = handler->create_istream(file_input, TRUE);
- while ((ret = i_stream_read_more(input, &data, &size)) > 0) {
+ while (i_stream_read_more(input, &data, &size) > 0) {
sha1_loop(&sha1, data, size);
i_stream_skip(input, size);
}
*error_r = "Invalid JWK key: Missing kty parameter";
return FALSE;
} else if (strcmp(value, "RSA") == 0) {
- if ((node = json_tree_find_key(root, "d")) != NULL)
+ if (json_tree_find_key(root, "d") != NULL)
kind = DCRYPT_KEY_KIND_PRIVATE;
else
kind = DCRYPT_KEY_KIND_PUBLIC;
} else if (strcmp(value, "EC") == 0) {
- if ((node = json_tree_find_key(root, "d")) != NULL)
+ if (json_tree_find_key(root, "d") != NULL)
kind = DCRYPT_KEY_KIND_PRIVATE;
else
kind = DCRYPT_KEY_KIND_PUBLIC;
{
const struct http_client_settings *set =
http_client_connection_get_settings(conn);
- int ret;
if (conn->in_req_callback) {
/* this can happen when a nested ioloop is created inside request
/* Active ioloop is different from what we saw earlier;
we may have missed a disconnection event on this connection.
Verify status by reading from connection. */
- if ((ret=i_stream_read(conn->conn.input)) == -1) {
+ if (i_stream_read(conn->conn.input) == -1) {
int stream_errno = conn->conn.input->stream_errno;
i_assert(conn->conn.input->stream_errno != 0 || conn->conn.input->eof);
http_url_parse_scheme(struct http_url_parser *url_parser, const char **scheme_r)
{
struct uri_parser *parser = &url_parser->parser;
- int ret;
*scheme_r = NULL;
if ((url_parser->flags & HTTP_URL_PARSE_SCHEME_EXTERNAL) != 0)
return TRUE;
- if ((ret = uri_parse_scheme(parser, scheme_r)) <= 0) {
+ if (uri_parse_scheme(parser, scheme_r) <= 0) {
parser->cur = parser->begin;
return FALSE;
}
static void imap_urlauth_input(struct imap_urlauth_connection *conn)
{
- int ret;
-
i_assert(conn->state != IMAP_URLAUTH_STATE_DISCONNECTED);
if (conn->input->closed) {
}
while (!conn->input->closed) {
- if ((ret = imap_urlauth_input_next(conn)) <= 0)
+ if (imap_urlauth_input_next(conn) <= 0)
break;
}
}
/* Parse path, i.e. `[ icommand ]` from `*( "/" segment )` */
if (ret > 0 || url_parser->relative) {
- if ((ret = imap_url_parse_path(url_parser, path, relative,
- &is_messagelist)) < 0)
+ if (imap_url_parse_path(url_parser, path, relative,
+ &is_messagelist) < 0)
return FALSE;
}
if (part->data == NULL) {
/* no Content-* headers. add an empty context
structure anyway. */
- part->data = part_data =
- p_new(pool, struct message_part_data, 1);
+ part->data = p_new(pool, struct message_part_data, 1);
} else if ((part->flags & MESSAGE_PART_FLAG_IS_MIME) == 0) {
/* If there was no Mime-Version, forget all
the Content-stuff */
if (part->data == NULL) {
/* initialize message part data */
- part->data = part_data =
- p_new(pool, struct message_part_data, 1);
+ part->data = p_new(pool, struct message_part_data, 1);
}
part_data = part->data;
ctx->data++;
str_append_c(str, '.');
- if ((ret = rfc822_skip_lwsp(ctx)) <= 0)
+ if (rfc822_skip_lwsp(ctx) <= 0)
return -1;
start = ctx->data;
}
struct message_part *parts2;
uoff_t i, input_size;
const char *error;
- int ret;
i_stream_seek(input, 0);
if (i_stream_get_size(input, TRUE, &input_size) < 0)
test_istream_set_size(input, i/2);
if (i > TEST_MSG_LEN*2)
test_istream_set_allow_eof(input, TRUE);
- while ((ret = message_parser_parse_next_block(parser,
- &block)) > 0) ;
+ while (message_parser_parse_next_block(parser, &block) > 0) ;
}
test_assert(message_parser_deinit_from_parts(&parser, &parts2, &error) == 0);
test_assert(msg_parts_cmp(parts, parts2));
struct smtp_param *param_r, const char **error_r)
{
struct smtp_parser parser;
- int ret;
i_zero(param_r);
smtp_parser_init(&parser, pool, text);
- if ((ret = smtp_param_do_parse(&parser, param_r)) <= 0) {
+ if (smtp_param_do_parse(&parser, param_r) <= 0) {
if (error_r != NULL)
*error_r = parser.error;
return -1;
str_append_c(literal, '.');
parser->cur++;
- if ((ret = smtp_parser_parse_snum(parser,
- literal, &octet)) <= 0)
+ if (smtp_parser_parse_snum(parser, literal, &octet) <= 0)
return -1;
ip = (ip << 8) + octet;
}
tagbuf = t_str_new(16);
str_append_c(tagbuf, '[');
}
- if ((ret=smtp_parser_parse_ldh_str(parser, tagbuf)) <= 0 ||
+ if (smtp_parser_parse_ldh_str(parser, tagbuf) <= 0 ||
parser->cur >= parser->end || *parser->cur != ':') {
parser->error = "Invalid address literal";
return -1;
if (ipv6) {
i_zero(&ip6);
- if ((ret = inet_pton(AF_INET6, t_strndup(pblock,
- parser->cur - pblock), &ip6)) <= 0) {
+ if (inet_pton(AF_INET6, t_strndup(pblock,
+ parser->cur - pblock), &ip6) <= 0) {
parser->error = "Invalid IPv6 address literal";
return -1;
}
struct smtp_server_transaction *trans = conn->state.trans;
const struct smtp_server_callbacks *callbacks = conn->callbacks;
struct smtp_server_command *command = cmd->cmd;
- int ret;
/* this command is next to send a reply */
smtp_server_command_ref(cmd_temp);
i_assert(callbacks != NULL &&
callbacks->conn_cmd_data_begin != NULL);
- if ((ret=callbacks->conn_cmd_data_begin(conn->context,
- cmd, conn->state.trans, conn->state.data_input)) < 0) {
+ if (callbacks->conn_cmd_data_begin(conn->context,
+ cmd, conn->state.trans, conn->state.data_input) < 0) {
i_assert(smtp_server_command_is_replied(cmd_temp));
/* command failed */
smtp_server_command_unref(&cmd_temp);
const char **value_r, const char **error_r)
{
struct smtp_parser parser;
- int ret;
if (string == NULL || *string == '\0') {
*value_r = "";
smtp_parser_init(&parser, pool_datastack_create(), string);
- if ((ret=smtp_parser_parse_string(&parser, value_r)) < 0) {
+ if (smtp_parser_parse_string(&parser, value_r) < 0) {
if (error_r != NULL)
*error_r = parser.error;
return -1;
{
struct smtp_parser parser;
string_t *value = NULL;
- int ret;
if (xtext == NULL || *xtext == '\0') {
*value_r = "";
value = t_str_new(256);
smtp_parser_init(&parser, pool_datastack_create(), xtext);
- if ((ret=smtp_parser_parse_xtext(&parser, value)) < 0) {
+ if (smtp_parser_parse_xtext(&parser, value) < 0) {
if (error_r != NULL)
*error_r = parser.error;
return -1;
const char *const **params_r, const char **error_r)
{
struct smtp_parser parser;
- int ret;
if (ehlo_line == NULL || *ehlo_line == '\0') {
if (error_r != NULL)
smtp_parser_init(&parser, pool_datastack_create(), ehlo_line);
- if ((ret=smtp_parse_ehlo_line(&parser, key_r, params_r)) <= 0) {
+ if (smtp_parse_ehlo_line(&parser, key_r, params_r) <= 0) {
if (error_r != NULL)
*error_r = parser.error;
return -1;
int ret;
/* first do a quick check that it doesn't exist */
- if ((ret = index_list_node_exists(list, box->name, &existence)) < 0) {
+ if (index_list_node_exists(list, box->name, &existence) < 0) {
mail_storage_copy_list_error(box->storage, box->list);
return -1;
}
const struct mail_index_record *rec;
enum mailbox_list_index_flags flags;
uint32_t seq;
- int ret;
- if ((ret = mailbox_list_index_view_open(box, FALSE, &view, &seq)) <= 0) {
+ if (mailbox_list_index_view_open(box, FALSE, &view, &seq) <= 0) {
/* failure / not found. fallback to the real storage check
just in case to see if the mailbox was just created. */
return ibox->module_ctx.super.
struct mailbox_status status;
guid_128_t mailbox_guid;
bool guid_changed = FALSE;
- int ret;
i_zero(&changes);
/* update the mailbox list index even if it has some other pending
changes. */
- if ((ret = mailbox_list_index_view_open(box, FALSE, &list_view, &changes.seq)) <= 0)
+ if (mailbox_list_index_view_open(box, FALSE, &list_view, &changes.seq) <= 0)
return;
guid_128_empty(mailbox_guid);
it should be saved as "pub/", but handle it anyway */
i_assert(strncmp(ns_name, ns->prefix, ns->prefix_len-1) == 0 &&
ns_name[ns->prefix_len-1] == '\0');
- name = ns_name = "";
+ name = "";
+ /* ns_name = ""; */
}
len = strlen(name);
str_append_c(literal, '.');
parser->cur++;
- if ((ret = uri_parse_dec_octet(parser, literal, &octet)) <= 0)
+ if (uri_parse_dec_octet(parser, literal, &octet) <= 0)
return -1;
ip = (ip << 8) + octet;
}
const unsigned char *p;
const char *address;
struct in6_addr ip6;
- int ret;
/* IP-literal = "[" ( IPv6address / IPvFuture ) "]"
* IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
"Future IP host address '%s' not supported", address);
return -1;
}
- if ((ret = inet_pton(AF_INET6, address, &ip6)) <= 0) {
+ if (inet_pton(AF_INET6, address, &ip6) <= 0) {
parser->error = p_strdup_printf(parser->pool,
"Invalid IPv6 host address '%s'", address);
return -1;
/* IP-literal / */
if (parser->cur < parser->end && *parser->cur == '[') {
- if ((ret=uri_parse_ip_literal(parser, literal, &ip6)) <= 0)
+ if (uri_parse_ip_literal(parser, literal, &ip6) <= 0)
return -1;
if (host != NULL) {
break;
var = NULL;
- if (*str == '{' && (end = strchr(str, '}')) != NULL) {
+ if (*str == '{' && strchr(str, '}') != NULL) {
/* %{long_key} */
unsigned int ctr = 1;
bool escape = FALSE;
{
struct smtp_server_recipient *rcpt = llrcpt->rcpt->rcpt;
struct smtp_server_cmd_ctx *cmd = rcpt->cmd;
- int ret;
- if ((ret = lmtp_local_rcpt_check_quota(llrcpt)) < 0)
+ if (lmtp_local_rcpt_check_quota(llrcpt) < 0)
return FALSE;
smtp_server_cmd_rcpt_reply_success(cmd);
static int doveadm_output(struct doveadm_connection *conn)
{
- int ret;
-
- if ((ret = o_stream_flush(conn->output)) != 0) {
+ if (o_stream_flush(conn->output) != 0) {
/* error / finished */
doveadm_connection_destroy(&conn);
}
struct auth_master_user_list_ctx *list_ctx;
enum auth_master_flags flags = 0;
struct auth_user_info info;
- const char *user;
int ret;
i_zero(&info);
auth_conn = auth_master_init(TEST_SOCKET, flags);
auth_master_set_timeout(auth_conn, 1000);
list_ctx = auth_master_user_list_init(auth_conn, "*", &info);
- while ((user = auth_master_user_list_next(list_ctx)) != NULL);
+ while (auth_master_user_list_next(list_ctx) != NULL);
ret = auth_master_user_list_deinit(&list_ctx);
auth_master_deinit(&auth_conn);
/* the file was opened with O_APPEND, so this write() should be
appended atomically without any need for locking. */
for (;;) {
- if ((ret = write_full(log->fd, buf->data, buf->used)) < 0) {
+ if (write_full(log->fd, buf->data, buf->used) < 0) {
i_error("write(%s) failed: %m", log->path);
if (ftruncate(log->fd, log->st.st_size) < 0)
i_error("ftruncate(%s) failed: %m", log->path);
t_array_init(&ids, 8);
/* figure out who needs the key */
- if ((ret = mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
- MAIL_ATTRIBUTE_TYPE_SHARED,
- &ids, &error)) < 0) {
+ if (mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
+ MAIL_ATTRIBUTE_TYPE_SHARED,
+ &ids, &error) < 0) {
i_error("mail_crypt_box_get_pvt_digests(%s, /shared) failed: %s",
mailbox_get_vname(box),
error);
FIXME: this could be less confusing altogether */
ret = 0;
} else {
- if ((ret = mail_crypt_box_generate_keypair(box, &pair,
- user_key, pubid_r, error_r)) < 0) {
+ if (mail_crypt_box_generate_keypair(box, &pair, user_key,
+ pubid_r, error_r) < 0) {
ret = -1;
} else {
*pubid_r = p_strdup(ctx->ctx.pool, *pubid_r);
void *context)
{
const char *error;
- int ret;
/* we need to use the mailbox attribute API here, as we
are not necessarily able to decrypt any of these keys
struct mail_attribute_value value;
i_zero(&value);
- if ((ret = mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
- USER_CRYPT_PREFIX
- ACTIVE_KEY_NAME,
- &value)) < 0) {
+ if (mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
+ USER_CRYPT_PREFIX ACTIVE_KEY_NAME,
+ &value) < 0) {
i_error("mailbox_get_attribute(%s, %s) failed: %s",
mailbox_get_vname(box),
USER_CRYPT_PREFIX ACTIVE_KEY_NAME,
array_clear(&ids);
/* get active ID */
- if ((ret = mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
- BOX_CRYPT_PREFIX
- ACTIVE_KEY_NAME,
- &value)) < 0) {
+ if (mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
+ BOX_CRYPT_PREFIX ACTIVE_KEY_NAME,
+ &value) < 0) {
i_error("mailbox_get_attribute(%s, %s) failed: %s",
mailbox_get_vname(box),
BOX_CRYPT_PREFIX ACTIVE_KEY_NAME,
mailbox_get_last_internal_error(box, NULL));
- } else if ((ret = mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
- MAIL_ATTRIBUTE_TYPE_PRIVATE,
- &ids, &error)) < 0) {
+ } else if (mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
+ MAIL_ATTRIBUTE_TYPE_PRIVATE,
+ &ids, &error) < 0) {
i_error("mail_crypt_box_get_pvt_digests(%s) failed: %s",
mailbox_get_vname(box),
error);