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

CID 1357056: Resource leaks in P_RefCountCache.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: HostDB
    • Labels:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: