[ 
https://issues.apache.org/jira/browse/TS-4606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15353503#comment-15353503
 ] 

ASF subversion and git services commented on TS-4606:
-----------------------------------------------------

Commit 67404970b32d2fc19b4dab606efa265aadfd5d9f in trafficserver's branch 
refs/heads/master from [~jacksontj]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=6740497 ]

TS-4606 TS-4331 0 is a valid FD


> 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
>            Assignee: Thomas Jackson
>              Labels: coverity
>             Fix For: 7.0.0
>
>
> {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