Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Hello,

In the file filters/binfilter/bf_svtools/source/items/svt_aeitem.cxx
We've got this :
SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
    SfxEnumItem(rCopy),
    pValues(0),
    pDisabledValues( 0 )
{
    DBG_CTOR(SfxAllEnumItem, 0);
    if ( !rCopy.pValues )
        return;

    pValues = new SfxAllEnumValueArr;

    for ( USHORT nPos = 0; nPos < rCopy.pValues->Count(); ++nPos )
    {
        SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
        pVal->nValue = rCopy.pValues->GetObject(nPos)->nValue;
        pVal->aText = rCopy.pValues->GetObject(nPos)->aText;
        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 since pVal mustn't be destroyed since it's indirectly used via pTemp in pValues.
Am i right or wrong ?

Julien.

(i just updated cppcheck with git and recompiled it)

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.