Text   |  XML   |  ReML   |   Visible Warnings:

Leak  at dbox-index.c:750

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

dbox_index_append_next

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-index.c)expand/collapse
Show more  
 720  int dbox_index_append_next(struct dbox_index_append_context *ctx,
 721                             uoff_t mail_size,
 722                             struct dbox_file **file_r,
 723                             struct ostream **output_r)
 724  {
 725          struct dbox_file *const *files, *file = NULL;
 726          struct dbox_index_record *records;
 727          unsigned int i, count;
 728          int ret;
 729   
 730          /* first try to use files already used in this append */
 731          files = array_get(&ctx->files, &count);
 732          for (i = 0; i < count; i++) {
 733                  if (dbox_file_get_append_stream(files[i], mail_size,
 734                                                  output_r) > 0) {
 735                          *file_r = files[i];
 736                          return 0;
 737                  }
 738          }
 739   
 740          /* try to find an existing appendable file */
 741          records = array_get_modifiable(&ctx->index->records, &count);
 742          for (i = 0; i < count; i++) {
 743                  if (dbox_index_append_file_record(ctx, &records[i], mail_size,
 744                                                    &file, output_r))
 745                          break;
 746          }
 747   
 748          if (file == NULL) {
 749                  /* create a new file */
 750[+]                 file = dbox_file_init(ctx->index->mbox, 0);
expand/collapse

dbox_file_init

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-file.c)expand/collapse
Show more  
 154  struct dbox_file *
 155  dbox_file_init(struct dbox_mailbox *mbox, unsigned int file_id)
 156  {
 157          struct dbox_file *file;
 158          unsigned int count;
 159          bool maildir;
 160   
 161          file = file_id == 0 ? NULL :
 162                  dbox_find_and_move_open_file(mbox, file_id);
 163          if (file != NULL) {
 164                  file->refcount++;
 165                  return file;
 166          }
 167   
 168          count = array_count(&mbox->open_files);
 169          if (count > mbox->max_open_files)
 170                  dbox_close_open_files(mbox, count - mbox->max_open_files);
 171   
 172[+]         file = i_new(struct dbox_file, 1);
expand/collapse

i_malloc

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.c)expand/collapse
Show more  
 7  void *i_malloc(size_t size)
 8  {
 9      void *rv = malloc(size);
 10      if( !rv )
 11          abort();
 12      return rv;
Show more  
 173          file->refcount = 1;
 174          file->mbox = mbox;
 175          if (file_id != 0) {
 176                  file->file_id = file_id;
 177                  file->fname = dbox_file_id_get_fname(mbox, file_id, &maildir);
 178                  file->maildir_file = maildir;
 179          } else {
 180                  file->fname = dbox_generate_tmp_filename();
 181          }
 182          if (file->maildir_file || file_id == 0) {
 183                  /* newly created files and maildir files always exist in the
 184                     primary path */
 185                  file->current_path =
 186                          i_strdup_printf("%s/%s", mbox->path, file->fname);
 187          }
 188          file->fd = -1;
 189   
 190          if (file_id != 0)
 191                  array_append(&file->mbox->open_files, &file, 1);
 192          return file;
Show more  
 751                  if ((ret = dbox_file_get_append_stream(file, mail_size,
 752[+]                                                        output_r)) <= 0) {
 753                          i_assert(ret < 0);
 754[+]                         (void)unlink(dbox_file_get_path(file));
 755[+]                         dbox_file_unref(&file);
expand/collapse

dbox_file_unref

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-file.c)expand/collapse
Show more  
 240  void dbox_file_unref(struct dbox_file **_file)
 241  {
 242          struct dbox_file *file = *_file;
 243          struct dbox_file *const *files;
 244          unsigned int i, count;
 245   
 246          *_file = NULL;
 247   
 248          i_assert(file->refcount > 0);
 249          if (--file->refcount > 0)
 250                  return;
 251   
 252          /* don't cache  seeks while file isn't being referenced */
 253          file-> = 0;
 254   
 255          if (file->file_id != 0) {
 256                  files = array_get(&file->mbox->open_files, &count);
 257                  if (!file->deleted && count <= file->mbox->max_open_files) {
 258                          /* we can leave this file open for now */
 259                          return;
Show more  
Show more  




Change Warning 11685.25664 : Leak

Priority:
State:
Finding:
Owner:
Note: