[Ocfs2-tools-devel] [PATCH] fsck.ocfs2: fix a minor memleak

Sunil Mushran sunil.mushran at oracle.com
Thu Nov 5 18:39:46 PST 2009


Tristan wrote:
> Sunil Mushran wrote:
>> Tristan wrote:
>>>
>>> I guess memory should not be placed there, it should be following 
>>> instead:
>>>
>>> else {
>>>
>>>         ret = OCFS2_ET_INTERNAL_FAILURE;
>>>         goto out;
>>>
>>> }
>>>
>>> out:
>>> if (dp)
>>> free(dp);
>>> ... 
>> I would imagine you mean....
>>
>> out:
>> if (ret && dp)
>>  free(dp);
> why need to '&&' with ret? shouldn't dp be released regardless of 
> whatever the ret was?

Why would we want to release it? We've just added it to the rb tree.



More information about the Ocfs2-tools-devel mailing list