pAttachName = _StringConverter::CopyToCharArrayN(pEmailAttachmentItem->GetName());
SysTryCatch(NID_MSG, pAttachName != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
pTempAttachmentData->attachment_name = strdup(pAttachName);
+ if (pAttachName)
+ {
+ delete[] pAttachName;
+ pAttachName = null;
+ }
pAttachFilePath = _StringConverter::CopyToCharArrayN(pEmailAttachmentItem->GetFilePath());
SysTryCatch(NID_MSG, pAttachFilePath != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
pTempAttachmentData->attachment_path = strdup(pAttachFilePath);
+ if (pAttachFilePath)
+ {
+ delete[] pAttachFilePath;
+ pAttachFilePath = null;
+ }
pTempAttachmentData->inline_content_status = (int) pEmailAttachmentItem->GetInlineContentStatus();
pTempAttachmentData->drm_status = (int) pEmailAttachmentItem->GetDrmStatus();
pAttachMimeType = _StringConverter::CopyToCharArrayN(pEmailAttachmentItem->GetMimeType());
SysTryCatch(NID_MSG, pAttachMimeType != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
pTempAttachmentData->attachment_mime_type = strdup(pAttachMimeType);
+ if (pAttachMimeType)
+ {
+ delete[] pAttachMimeType;
+ pAttachMimeType = null;
+ }
pTempAttachmentData++;
}
pEmlFilePath = null;
}
- if (pAttachName)
- {
- delete[] pAttachName;
- pAttachName = null;
- }
-
- if (pAttachFilePath)
- {
- delete[] pAttachFilePath;
- pAttachFilePath = null;
- }
-
- if (pAttachMimeType)
- {
- delete[] pAttachMimeType;
- pAttachMimeType = null;
- }
-
if (pMailData)
{
email_free_mail_data(&pMailData, 1);