Text   |  XML   |  ReML   |   Visible Warnings:

Leak  at cmd-status.c:40

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

cmd_status

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/cmd-status.c)expand/collapse
Show more  
 9  bool cmd_status(struct client_command_context *cmd)
 10  {
 11          struct client *client = cmd->client;
 12          const struct imap_arg *args;
 13          struct mailbox_status status;
 14          enum mailbox_status_items items;
 15          struct mail_storage *storage;
 16          const char *mailbox, *real_mailbox;
 17          bool selected_mailbox;
 18   
 19          /* <mailbox> <status items> */
 20[+]         if (!client_read_args(cmd, 2, 0, &args))
 21                  return FALSE;
 22   
 23[+]         mailbox = real_mailbox = imap_arg_string(&args[0]);
 24          if (mailbox == NULL || args[1].type != IMAP_ARG_LIST) {
 25                  client_send_command_error(cmd, "Status items must be list.");
 26                  return TRUE;
 27          }
 28   
 29          /* get the items client wants */
 30          if (imap_status_parse_items(cmd, IMAP_ARG_LIST_ARGS(&args[1]),
 31[+]                                     &items) < 0)
 32                  return TRUE;
 33   
 34          storage = client_find_storage(cmd, &real_mailbox);
 35          if (storage == NULL)
 36                  return TRUE;
 37   
 38          selected_mailbox = client->mailbox != NULL &&
 39                  mailbox_equals(client->mailbox, storage, real_mailbox);
 40[+]         if (!imap_status_get(client, storage, real_mailbox, items, &status)) {
expand/collapse

imap_status_get

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/imap-status.c)expand/collapse
Show more  
 49  bool imap_status_get(struct client *client, struct mail_storage *storage,
 50                       const char *mailbox, enum mailbox_status_items items,
 51                       struct mailbox_status *status_r)
 52  {
 53          struct mailbox *box;
 54          int ret;
 55   
 56          if (client->mailbox != NULL &&
 57[+]             mailbox_equals(client->mailbox, storage, mailbox)) {
 58                  /* this mailbox is selected */
 59                  mailbox_get_status(client->mailbox, items, status_r);
 60                  return TRUE;
 61          }
 62   
 63          /* open the mailbox */
 64          box = mailbox_open(&storage, mailbox, NULL, MAILBOX_OPEN_FAST |
 65[+]                            MAILBOX_OPEN_READONLY | MAILBOX_OPEN_KEEP_RECENT);
expand/collapse

mailbox_open

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-storage.c)expand/collapse
Show more  
 456  struct mailbox *mailbox_open(struct mail_storage **_storage, const char *name,
 457                               struct istream *input,
 458                               enum mailbox_open_flags flags)
 459  {
 460          struct mail_storage *storage = *_storage;
 461          struct mailbox *box;
 462   
 463          if (storage->list->v.get_storage != NULL) {
 464                  if (storage->list->v.get_storage(storage->list,
 465                                                   &name, &storage) < 0)
 466                          return NULL;
 467                  *_storage = storage;
 468          }
 469   
 470          mail_storage_clear_error(storage);
 471   
 472[+]         if (!mailbox_list_is_valid_existing_name(storage->list, name)) {
 473                  mail_storage_set_error(storage, MAIL_ERROR_PARAMS,
 474[+]                                        "Invalid mailbox name");
expand/collapse

mail_storage_set_error

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-storage.c)expand/collapse
Show more  
 273  void mail_storage_set_error(struct mail_storage *storage,
 274                              enum mail_error error, const char *string)
 275  {
 276          i_free(storage->error_string);
 277[+]         storage->error_string = i_strdup(string);
expand/collapse

i_strdup

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.c)expand/collapse
Show more  
 23  char *i_strdup(const char *str)
 24  {
 25      char *rv = strdup( str );
 26      if( !rv )
 27          abort();
 28      return rv;
Show more  
 278          storage->error = error;
Show more  
Show more  
Show more  
Show more  




Change Warning 12011.24934 : Leak

Priority:
State:
Finding:
Owner:
Note: