[ 
https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29177&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29177
 ]

ASF GitHub Bot logged work on TS-4872:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Sep/16 19:18
            Start Date: 15/Sep/16 19:18
    Worklog Time Spent: 10m 
      Work Description: Github user PSUdaemon commented on a diff in the pull 
request:

    https://github.com/apache/trafficserver/pull/1025#discussion_r79040648
  
    --- Diff: proxy/logging/LogObject.cc ---
    @@ -354,6 +354,38 @@ LogObject::display(FILE *fd)
       fprintf(fd, 
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
     }
     
    +static head_p
    +increment_pointer_version(volatile head_p *dst)
    +{
    +  head_p h;
    +  head_p new_h;
    +
    +  do {
    +    INK_QUEUE_LD(h, *dst);
    +    SET_FREELIST_POINTER_VERSION(new_h, FREELIST_POINTER(h), 
FREELIST_VERSION(h) + 1);
    +  } while (ink_atomic_cas(&dst->data, h.data, new_h.data) == false);
    +
    +  return h;
    +}
    +
    +static bool
    +write_pointer_value(volatile head_p *dst, head_p old_h, void *ptr)
    +{
    +  head_p tmp_h;
    +
    +  SET_FREELIST_POINTER_VERSION(tmp_h, ptr, 0);
    +  return ink_atomic_cas(&dst->data, old_h.data, tmp_h.data);
    +}
    +
    +static bool
    +write_pointer_value_vers(volatile head_p *dst, head_p old_h, void *ptr, 
head_p::version_type vers)
    +{
    +  head_p tmp_h;
    +
    +  SET_FREELIST_POINTER_VERSION(tmp_h, ptr, vers);
    +  return ink_atomic_cas(&dst->data, old_h.data, tmp_h.data);
    +}
    --- End diff --
    
    Can these two functions be merged? Seems like `write_pointer_value` can 
just call `write_pointer_value_vers` with `0` for the version?


Issue Time Tracking
-------------------

    Worklog Id:     (was: 29177)
    Time Spent: 20m  (was: 10m)

> clang-analyzer: Memory leak LogObject.cc _checkout_write
> --------------------------------------------------------
>
>                 Key: TS-4872
>                 URL: https://issues.apache.org/jira/browse/TS-4872
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Leif Hedstrom
>            Assignee: James Peach
>              Labels: clang-analyzer
>             Fix For: 7.0.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> We could not quite figure out why it reports this (smells almost like a bug 
> in clang-analyzer), but [[email protected]] has a refactoring that avoids 
> the warning, and cleans up the code overall.



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

Reply via email to