I discover memory leak problem GlucoseSensor_processServiceEvt() function at clucose.c
Heap Memroy is allocated pData->pVal in GlucoseSensor_serviceCB() fuction.
Memroy free in GlucoseSensor_processServiceEvt() function
But It is only memory free in GLUCOSE_CTL_PNT_CMD.
but other case don't free memory
(etc, GLUCOSE_MEAS_NTF_ENABLED,GLUCOSE_MEAS_NTF_DISABLED,GLUCOSE_CONTEXT_NTF_ENABLED.....)
I fixed GlucoseSensor_processServiceEvt() function.
=====================================================================
static void GlucoseSensor_processServiceEvt(uint8_t event, uint8_t* valueP, uint8_t len)
{
switch (event)
{
// Control point command.
case GLUCOSE_CTL_PNT_CMD:
{
glucoseCtlPntMsg_t msg;
msg.len = len;
memcpy(msg.data, valueP, len);
// Free valueP
// ICall_free(valueP);
// Process the control point command.
GlucoseSensor_processCtlPntMsg(&msg);
}
break;
default:
// Do nothing.
break;
}
ICall_free(valueP);
}
=======================================================
Br
yjkim