[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Suboptimal and suspicious patterns using COM macros and functions

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 12 Aug 2009 08:02:03 +0200

On 11.08.2009 11:13, Dmitry wrote:
> steveking wrote:
>
>>> 2. In src\TortoiseShell\​ItemIDList.cpp near the end of>>ItemIDList::toString() method there's a condition:
>>> if (szDisplayName == NULL)
>>> {
>>> CoTaskMemFree(szDisplayName);
>>> return ret; //to avoid a crash!
>>> }
>>> The call to CoTaskMemFree() will have no effect if szDisplayName>>is NULL - this call only pollutes the code.
>
>> here, the if() clause is not because of CoTaskMemFree() but because the
>> next line
>> ret = szDisplayName;
>> would crash if szDisplayName is NULL (you can't assign NULL to an
>> std::string).
>
> Yeap, I understand that. This part is necessary. I wanted to say that the call to CoTaskMemFree() is redundant.

Right, that call really is redundant.
Removed in r16903.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2382792
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-08-12 08:02:34 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.