Leif Hedstrom created TS-4606:
---------------------------------

             Summary: CID 1357056:  Resource leaks in P_RefCountCache.
                 Key: TS-4606
                 URL: https://issues.apache.org/jira/browse/TS-4606
             Project: Traffic Server
          Issue Type: Bug
          Components: HostDB
            Reporter: Leif Hedstrom


{code}
** 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));
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to