Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at deliver.c:226

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

deliver_save

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/deliver/deliver.c)expand/collapse
Show more  
 208  int deliver_save(struct mail_namespace *namespaces,
 209                   struct mail_storage **storage_r, const char *mailbox,
 210                   struct mail *mail, enum mail_flags flags,
 211                   const char *const *keywords)
 212  {
 213          struct mailbox *box;
 214          struct mailbox_transaction_context *t;
 215          struct mail_save_context *save_ctx;
 216          struct mail_keywords *kw;
 217          enum mail_error error;
 218          const char *mailbox_name;
 219          bool default_save;
 220          int ret = 0;
 221   
 222          default_save = strcmp(mailbox, default_mailbox_name) == 0;
 223          if (default_save)
 224                  tried_default_save = TRUE;
 225   
 226          mailbox_name = str_sanitize(mailbox, 80);
 227          box = mailbox_open_or_create_synced(namespaces, storage_r, mailbox);
 228          if (box == NULL) {
 229                  if (*storage_r == NULL) {
 230                          deliver_log(mail,
 231                                      "save failed to %s: Unknown namespace",
 232                                      mailbox_name);
 233                          return -1;
 234                  }
 235                  if (default_save &&
 236                      strcmp((*storage_r)->ns->prefix, mailbox) == 0) {
 237                          /* silently store to the INBOX instead */
 238                          return -1;
 239                  }
 240                  deliver_log(mail, "save failed to %s: %s", mailbox_name,
 241                              mail_storage_get_last_error(*storage_r, &error));
 242                  return -1;
 243          }
 244   
 245          t = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL);
 246   
 247          kw = str_array_length(keywords) == 0 ? NULL :
 248                  mailbox_keywords_create_valid(box, keywords);
 249          save_ctx = mailbox_save_alloc(t);
 250          mailbox_save_set_flags(save_ctx, flags, kw);
 251          if (mailbox_copy(&save_ctx, mail) < 0)
 252                  ret = -1;
 253          mailbox_keywords_free(box, &kw);
 254   
 255          if (ret < 0)
 256                  mailbox_transaction_rollback(&t);
 257          else 
 258                  ret = mailbox_transaction_commit(&t);
 259   
 260          if (ret == 0) {
 261                  saved_mail = TRUE;
 262                  deliver_log(mail, "saved mail to %s", mailbox_name);
 263          } else {
 264                  deliver_log(mail, "save failed to %s: %s", mailbox_name,
 265                              mail_storage_get_last_error(*storage_r, &error));
 266          }
 267   
 268          mailbox_close(&box);
 269          return ret;
 270  }
Show more  




Change Warning 11803.26085 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: