On 06/01/2011 11:49 PM, Jan Friesse wrote:
> Steven Dake wrote:
>> On 06/01/2011 09:14 AM, Jan Friesse wrote:
>>> Signed-off-by: Jan Friesse <[email protected]>
>>> ---
>>>  services/votequorum.c |    5 +++++
>>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/services/votequorum.c b/services/votequorum.c
>>> index 5b89359..291da4b 100644
>>> --- a/services/votequorum.c
>>> +++ b/services/votequorum.c
>>> @@ -1052,6 +1052,11 @@ static void 
>>> message_handler_req_exec_votequorum_nodeinfo (
>>>     if (new_node || req_exec_quorum_nodeinfo->first_trans || 
>>>         old_votes != node->votes || old_expected != node->expected_votes || 
>>> old_state != node->state)
>>>             recalculate_quorum(0, 0);
>>> +
>>> +   if (!nodeid) {
>>> +           free(node);
>>> +   }
>>> +
>>>     LEAVE();
>>>  }
>>>  
>>
>> I believe we want to persist the nodeid data structure, and in this case
>> the leak is expected behavior.  A better choice would be a comment
>> indicating that nodeid is leaked permanently as part of the system
>> operation rather then having this free operation.
> 
> Take a look to source code.
> allocate_node called on 1002 will test nodeid != 0 on 812. If it is not
> != 0 it will add to list, but if nodeid IS 0, it is not added to list
> and memory is simply returned. So actually if nodeid !=0 we want to free
> it and not keep it, because it is really leak.
> 

Reviewed-by: Steven Dake <[email protected]>
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to