Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4606

CID 1357056: Resource leaks in P_RefCountCache.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0
    • HostDB

    Description

      ** CID 1357056:  Resource leaks  (RESOURCE_LEAK)
      /iocore/hostdb/P_RefCountCache.h: 823 in LoadRefCountCacheFromPath<HostDBInfo>(RefCountCache<T1> &, std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::basic_string<char, std::char_traits<char>, std::allocator<char>>, T1 *(*)(char *, unsigned int))()
      
      
      ________________________________________________________________________________________________________
      *** CID 1357056:  Resource leaks  (RESOURCE_LEAK)
      /iocore/hostdb/P_RefCountCache.h: 823 in LoadRefCountCacheFromPath<HostDBInfo>(RefCountCache<T1> &, std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::basic_string<char, std::char_traits<char>, std::allocator<char>>, T1 *(*)(char *, unsigned int))()
      817       if (load_func == NULL) {
      818         return -1; // TODO: some specific error code
      819       }
      820     
      821       int fd = open(filepath.c_str(), O_RDONLY);
      822       if (fd <= 0) {
         CID 1357056:  Resource leaks  (RESOURCE_LEAK)
         Handle variable "fd" going out of scope leaks the handle.
      823         return -1; // specific code for missing?
      824       }
      825     
      826       // read in the header
      827       RefCountCacheHeader tmpHeader = RefCountCacheHeader();
      828       int read_ret                  = read(fd, (char *)&tmpHeader, sizeof(RefCountCacheHeader));
      

      Attachments

        Activity

          People

            jacksontj Thomas Jackson
            zwoop Leif Hedstrom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: