Is this a memory leak?
"Hwang, Johnny" <[email protected]> Wed, 19 Sep 2012 04:35:19 +0000
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <59187A369D10D048A8A8B52B1BD1FEA50D2C534E@SACEXCMBX02-PRD.hq.netapp.com> |
This is in src/Pegasus/ProviderManager2/CMPI/CMPI_Broker.cpp, circa line 900.
static CMPIStatus mbDeliverIndication(
const CMPIBroker* eMb,
const CMPIContext* ctx,
const char *ns,
const CMPIInstance* ind)
{
PEG_METHOD_ENTER(
TRC_CMPIPROVIDERINTERFACE,
"CMPI_Broker:mbDeliverIndication()");
// If no valid broker was passed in we try the use the broker
// that was stored in the local thread context
if (eMb==NULL)
{
eMb = CM_BROKER;
}
CMPI_Broker *mb = (CMPI_Broker*)eMb;
IndProvRecord *indProvRec;
OperationContext* context = CM_Context(ctx);
SCMOInstance* scmoInst = SCMO_Instance(ind);
CIMInstance indInst;
scmoInst->getCIMInstance(indInst); //*** <- IS THIS A MEMORY LEAK?!?!? Does this guy need to be freed explicitly? getCIMInstance() calls new() in its stack.***
...
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_ERR_FAILED);
}
}
This is my valgrind feed:
> ==14407== 71,088 bytes in 1,481 blocks are possibly lost in loss record 4,369 of 4,489
> ==14407== at 0x4C710D5: operator new(unsigned int) (vg_replace_malloc.c:214)
> ==14407== by 0x7A65AAE: Pegasus::CIMInstanceRep::clone() const (CIMInstanceRep.h:64)
> ==14407== by 0x7A81101: Pegasus::CIMObject::clone() const (CIMObject.cpp:229)
> ==14407== by 0x7AA5A0F: Pegasus::CIMValue::set(Pegasus::CIMObject const&) (CIMValue.cpp:797)
> ==14407== by 0x7A22575: Pegasus::SCMOInstance::_getCIMValueFromSCMBUnion(Pegasus::CIMValue&, Pegasus::CIMType, bool, bool, unsigned int, Pegasus::SCMBUnion const&, char const*) (SCMO.cpp:2175)
> ==14407== by 0x7A22919: Pegasus::SCMOInstance::_getCIMValueFromSCMBValue(Pegasus::CIMValue&, Pegasus::SCMBValue const&, char const*) (SCMO.cpp:2244)
> ==14407== by 0x7A22BEC: Pegasus::SCMOInstance::_getCIMPropertyAtNodeIndex(unsigned int) const (SCMO.cpp:1747)
> ==14407== by 0x7A23B1A: Pegasus::SCMOInstance::getCIMInstance(Pegasus::CIMInstance&) const (SCMO.cpp:1633)
> ==14407== by 0xC0CE632: mbDeliverIndication (CMPI_Broker.cpp:928)
> ==14407== by 0xC12BD14: sendIndicationFunction (x.c:x)<- this line reads "pBrk->bft->deliverIndication(pBrk, pCtx, pNamespace,...)"
> ==14407==
I have nowhere near 1481 indication items to process. More in the order of low hundreds, run for several cycles. Therefore, this is not an individual cycle, but continuously piled up over time and is most likely a leak.
Thanks for understanding,
Johnny Hwang