You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2016/06/28 17:30:57 UTC

[jira] [Commented] (TS-4606) CID 1357056: Resource leaks in P_RefCountCache.

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

Leif Hedstrom commented on TS-4606:
-----------------------------------

[~jacksontj] Can you take a look at this please? 

> 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)