err = plg->getMmsMessage(pMsg, pSendOptInfo, &pDestMsg);
if (err != MSG_SUCCESS) {
if (pDestMsg) {
- free(pDestMsg);
+ delete [] pDestMsg;
pDestMsg = NULL;
}
return MSG_ERR_STORAGE_ERROR;
if (MsgCreateFileName(tempFileName) == false) {
if(pDestMsg) {
- free(pDestMsg);
+ delete [] pDestMsg;
pDestMsg = NULL;
}
return MSG_ERR_STORAGE_ERROR;
if (MsgWriteIpcFile(tempFileName, pDestMsg, pMsg->dataSize) == false) {
if(pDestMsg) {
- free(pDestMsg);
+ delete [] pDestMsg;
pDestMsg = NULL;
}
return MSG_ERR_STORAGE_ERROR;
pMsg->dataSize = temp_size; /*raw file size; */
if (pDestMsg) {
- free(pDestMsg);
+ delete [] pDestMsg;
pDestMsg = NULL;
}
}
case MSG_LIST_CONDITION_ADDRESS_VALUE_STR:
if (size) {
if (cond->pAddressVal) {
- delete cond->pAddressVal;
+ delete [] cond->pAddressVal;
cond->pAddressVal = NULL;
}
cond->pAddressVal = (char *)new char[size+1];
case MSG_LIST_CONDITION_TEXT_VALUE_STR:
if (size) {
if (cond->pTextVal) {
- delete cond->pTextVal;
+ delete [] cond->pTextVal;
cond->pTextVal = NULL;
}
cond->pTextVal = (char *)new char[size+1];
pCond->sortRule = NULL;
if (pCond->pAddressVal) {
- delete pCond->pAddressVal;
+ delete [] pCond->pAddressVal;
pCond->pAddressVal = NULL;
}
if (pCond->pTextVal) {
- delete pCond->pTextVal;
+ delete [] pCond->pTextVal;
pCond->pTextVal = NULL;
}
snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", pTempFileName);
}
- free(pSerializedMms);
+ delete [] pSerializedMms;
}
MsgMmsRelease(&mms_data);
MSG_DEBUG("Serialize bufsize = %d", bufsize);
- buf = (char *)calloc(1, bufsize);
+ buf = new char[bufsize];
if (buf == NULL)
return -1;
+ memset(buf, 0x00, bufsize);
+
int serial_index = 0;
int offset = 0;
pObject->valueCount = 1;
if (pFileData) {
- free(pFileData);
+ delete [] pFileData;
pFileData = NULL;
}
}