SVACE detected problem with code DEREF_OF_NULL.RET.ALLOC.
[Verification] Code compiles.
Change-Id: Ibf604637e9f9d08e8c486a421afd94bbe6d6bddc
Signed-off-by: Szymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
if (ret.IsError()) return ret;
email_attachment_data_t* tmp = (email_attachment_data_t*)calloc(1, sizeof(email_attachment_data_t));
+ if (nullptr == tmp) {
+ return LogAndCreateResult(
+ ErrorCode::UNKNOWN_ERR, "Unknown error while adding attachment.");
+ }
tmp->attachment_name = strdup(att->getShortFileName().c_str());
tmp->attachment_path = strdup(std::string(dirPath + "/"
+ att->getShortFileName()).c_str());