On Sat, 2010-11-20 at 08:37 +0100, Julien Nabet wrote:

>          SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
...
>          const SfxAllEnumValue_Impl *pTemp = pVal;
...
>          pValues->Insert( pTemp, nPos );

> And cppcheck says :
> Checking ./filters/binfilter/bf_svtools/source/items/svt_aeitem.cxx...
> [./filters/binfilter/bf_svtools/source/items/svt_aeitem.cxx:110]: 
> (error) Memory leak: pVal
> 
> In my opinion it's a false positive

Without looking at the full impl of SfxAllEnumValueArr its hard to tell.
I would imagine that cppcheck can't tell either :-). So, just for the
sake of a cppcheck test change

const SfxAllEnumValue_Impl *pTemp = pVal;
pValues->Insert( pTemp, nPos );

to 

pValues->Insert( pVal, nPos );

or

pValues->Insert( (const SfxAllEnumValue_Impl*)pTmp, nPos );

and see if cppcheck still complains, or if the cast has confused it.

C.

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to