Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at expire-plugin.c:128

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

expire_mailbox_transaction_commit

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/expire/expire-plugin.c)expand/collapse
Show more  
 94  expire_mailbox_transaction_commit(struct mailbox_transaction_context *t,
 95                                    uint32_t *uid_validity_r,
 96                                    uint32_t *first_saved_uid_r,
 97                                    uint32_t *last_saved_uid_r)
 98  {
 99          struct expire_mailbox *xpr_box = EXPIRE_CONTEXT(t->box);
 100          struct expire_transaction_context *xt = EXPIRE_CONTEXT(t);
 101          struct mailbox *box = t->box;
 102          time_t new_stamp;
 103          bool update_dict = FALSE;
 104          int ret;
 105   
 106          if (xpr_box->altmove) {
 107                  /* only moving mails - don't update the move stamps */
 108          } else if (xt->first_expunged) {
 109                  /* first mail expunged. dict needs updating. */
 110                  first_nonexpunged_timestamp(t, &new_stamp);
 111                  update_dict = TRUE;
 112          }
 113   
 114          if (xpr_box->module_ctx.super.
 115                  transaction_commit(t, uid_validity_r,
 116                                     first_saved_uid_r, last_saved_uid_r) < 0) {
 117                  i_free(xt);
 118                  return -1;
 119          }
 120          /* transaction is freed now */
 121          t = NULL;
 122   
 123          if (xt->first_expunged || xt->saves) T_BEGIN {
 124                  const char *key, *value;
 125   
 126                  key = t_strconcat(DICT_EXPIRE_PREFIX,
 127                                    box->storage->ns->user->username, "/",
 128                                    box->storage->ns->prefix, box->name, NULL);
 129                  if (!xt->first_expunged && xt->saves) {
 130                          /* saved new mails. dict needs to be updated only if 
 131                             this is the first mail in the database */
 132                          ret = dict_lookup(expire.db, pool_datastack_create(),
 133                                            key, &value);
 134                          update_dict = ret == 0 ||
 135                                  (ret > 0 && strtoul(value, NULL, 10) == 0);
 136                          /* may not be exactly the first message's save time
 137                             but a few second difference doesn't matter */
 138                          new_stamp = ioloop_time;
 139                  }
 140   
 141                  if (update_dict) {
 142                          struct dict_transaction_context *dctx;
 143   
 144                          dctx = dict_transaction_begin(expire.db);
 145                          if (new_stamp == 0) {
 146                                  /* everything expunged */
 147                                  dict_unset(dctx, key);
 148                          } else {
 149                                  new_stamp += xpr_box->expire_secs;
 150                                  dict_set(dctx, key, dec2str(new_stamp));
 151                          }
 152                          dict_transaction_commit(&dctx);
 153                  }
 154          } T_END;
 155          i_free(xt);
 156          return 0;
 157  }
Show more  




Change Warning 8180.26095 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: