Text   |  XML   |  ReML   |   Visible Warnings:

Free Null Pointer  at file-dotlock.c:607

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

file_dotlock_delete

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-dotlock.c)expand/collapse
Show more  
 691  int file_dotlock_delete(struct dotlock **dotlock_p)
 692  {
 693          struct dotlock *dotlock;
 694          const char *lock_path;
 695          struct stat st;
 696   
 697          dotlock = *dotlock_p;
 698          *dotlock_p = NULL;
 699   
 700          lock_path = file_dotlock_get_lock_path(dotlock);
 701[+]         if (nfs_safe_lstat(lock_path, &st) < 0) {
 702                  if (errno == ENOENT) {
 703                          dotlock_replaced_warning(dotlock, TRUE);
 704                          file_dotlock_free(&dotlock);
 705                          return 0;
 706                  }
 707   
 708                  i_error("lstat(%s) failed: %m", lock_path);
 709                  file_dotlock_free(&dotlock);
 710                  return -1;
 711          }
 712   
 713          if (dotlock->ino != st.st_ino ||
 714              !CMP_DEV_T(dotlock->dev, st.st_dev)) {
 715[+]                 dotlock_replaced_warning(dotlock, FALSE);
 716                  errno = EEXIST;
 717[+]                 file_dotlock_free(&dotlock);
expand/collapse

file_dotlock_free

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-dotlock.c)expand/collapse
Show more  
 591  static void file_dotlock_free(struct dotlock **_dotlock)
 592  {
 593          struct dotlock *dotlock = *_dotlock;
 594          int old_errno;
 595   
 596          *_dotlock = NULL;
 597   
 598          if (dotlock->fd != -1) {
 599                  old_errno = errno;
 600                  if (close(dotlock->fd) < 0)
 601                          i_error("close(%s) failed: %m", dotlock->path);
 602                  dotlock->fd = -1;
 603                  errno = old_errno;
 604          }
 605   
 606          i_free(dotlock->path);
 607          i_free(dotlock->lock_path);
Show more  
Show more  




Change Warning 11415.24736 : Free Null Pointer

Priority:
State:
Finding:
Owner:
Note: