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

ASF GitHub Bot commented on TS-3984:
------------------------------------

Github user bryancall commented on the pull request:

    https://github.com/apache/trafficserver/pull/316#issuecomment-153545093
  
    I got a bunch of errors applying this patch:
    dispatch.cc:46:26: error: comparison between NULL and non-pointer 
('std::auto_ptr<ats::io::IO>' and NULL) [-Werror,-Wnull-arithmetic]
      (__builtin_expect(!(io != __null), 0) ? __assert_rtn(__func__, 
"dispatch.cc", 46, "io != NULL") : (void)0);
                          ~~ ^  ~~~~~~
    dispatch.cc:46:26: error: invalid operands to binary expression 
('std::auto_ptr<ats::io::IO>' and 'long')
      (__builtin_expect(!(io != __null), 0) ? __assert_rtn(__func__, 
"dispatch.cc", 46, "io != NULL") : (void)0);
                          ~~ ^  ~~~~~~
    dispatch.cc:221:38: error: comparison between NULL and non-pointer 
('std::auto_ptr<ats::io::IO>' and NULL) [-Werror,-Wnull-arithmetic]
        (__builtin_expect(!(iterator->io != __null), 0) ? 
__assert_rtn(__func__, "dispatch.cc", 221, "iterator->io != NULL") : (void)0);
                            ~~~~~~~~~~~~ ^  ~~~~~~
    dispatch.cc:221:38: error: invalid operands to binary expression 
('std::auto_ptr<ats::io::IO>' and 'long')
        (__builtin_expect(!(iterator->io != __null), 0) ? 
__assert_rtn(__func__, "dispatch.cc", 221, "iterator->io != NULL") : (void)0);
                            ~~~~~~~~~~~~ ^  ~~~~~~
    dispatch.cc:234:38: error: comparison between NULL and non-pointer 
('std::auto_ptr<ats::io::IO>' and NULL) [-Werror,-Wnull-arithmetic]
        (__builtin_expect(!(iterator->io != __null), 0) ? 
__assert_rtn(__func__, "dispatch.cc", 234, "iterator->io != NULL") : (void)0);
                            ~~~~~~~~~~~~ ^  ~~~~~~
    dispatch.cc:234:38: error: invalid operands to binary expression 
('std::auto_ptr<ats::io::IO>' and 'long')
        (__builtin_expect(!(iterator->io != __null), 0) ? 
__assert_rtn(__func__, "dispatch.cc", 234, "iterator->io != NULL") : (void)0);
                            ~~~~~~~~~~~~ ^  ~~~~~~
    In file included from dispatch.cc:26:
    In file included from ./dispatch.h:27:
    
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1673:31:
 error: no matching constructor for initialization of 'Request'
                ::new((void*)__p) _Up(std::__1::forward<_Args>(__args)...);
                                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1600:18:
 note: in instantiation of function template specialization 
'std::__1::allocator<Request>::construct<Request, Request>' requested here
                {__a.construct(__p, std::__1::forward<_Args>(__args)...);}
                     ^
    
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1453:14:
 note: in instantiation of function template specialization 
'std::__1::allocator_traits<std::__1::allocator<Request> 
>::__construct<Request, Request>' requested here
                {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
                 ^
    
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1609:25:
 note: in instantiation of function template specialization 
'std::__1::allocator_traits<std::__1::allocator<Request> >::construct<Request, 
Request>' requested here
            __alloc_traits::construct(this->__alloc(),
                            ^
    dispatch.cc:205:7: note: in instantiation of member function 
'std::__1::vector<Request, std::__1::allocator<Request> >::push_back' requested 
here
        r.push_back(Request(host, buffer, location));
          ^
    ./dispatch.h:51:8: note: candidate constructor (the implicit copy 
constructor) not viable: expects an l-value for 1st argument
    struct Request {
           ^
    dispatch.cc:38:10: note: candidate constructor not viable: requires 3 
arguments, but 1 was provided
    Request::Request(const std::string &h, const TSMBuffer b, const TSMLoc l)


> CID 1328817:  Resource leaks  (CTOR_DTOR_LEAK) in multiplexer plugin
> --------------------------------------------------------------------
>
>                 Key: TS-3984
>                 URL: https://issues.apache.org/jira/browse/TS-3984
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Plugins
>            Reporter: Leif Hedstrom
>            Assignee: Bryan Call
>             Fix For: 6.1.0
>
>
> {code}
> ** CID 1328817:  Resource leaks  (CTOR_DTOR_LEAK)
> /plugins/experimental/multiplexer/dispatch.cc: 39 in Request::Request(const 
> std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, 
> tsapi_mbuffer *, tsapi_mloc *)()
> ________________________________________________________________________________________________________
> *** CID 1328817:  Resource leaks  (CTOR_DTOR_LEAK)
> /plugins/experimental/multiplexer/dispatch.cc: 39 in Request::Request(const 
> std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, 
> tsapi_mbuffer *, tsapi_mloc *)()
> 33     
> 34     extern Statistics statistics;
> 35     
> 36     extern size_t timeout;
> 37     
> 38     Request::Request(const std::string &h, const TSMBuffer b, const TSMLoc 
> l)
>    CID 1328817:  Resource leaks  (CTOR_DTOR_LEAK)
>    The constructor allocates field "io" of "Request" but there is no 
> destructor.
> 39       : host(h), length(TSHttpHdrLengthGet(b, l)), io(new ats::io::IO())
> 40     {
> 41       assert(!host.empty());
> 42       assert(b != NULL);
> 43       assert(l != NULL);
> 44       assert(io != NULL);
> {code}



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

Reply via email to