summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyeonghun Lee <kh9090.lee@samsung.com>2017-02-07 17:34:02 +0900
committerKyeonghun Lee <kh9090.lee@samsung.com>2017-02-07 00:36:14 -0800
commitc27f2a877ee8d78d1ee1e6d785dbbee136153edc (patch)
tree10cf035d4b2250bd6e45babccd3ae26314830354
parent03d3f5d4b794776f7b2b0477d41585dfa54e007f (diff)
downloadmsg-service-c27f2a877ee8d78d1ee1e6d785dbbee136153edc.tar.gz
msg-service-c27f2a877ee8d78d1ee1e6d785dbbee136153edc.tar.bz2
msg-service-c27f2a877ee8d78d1ee1e6d785dbbee136153edc.zip
fix svace issues
Change-Id: If640fc43c9aade6fd36e46d4de50bc1005187a4b Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
-rwxr-xr-xframework/storage-handler/MsgStorageMessage.cpp28
-rwxr-xr-xframework/transaction-manager/MsgTransManager.cpp4
-rw-r--r--manager/src/msg-manager-notification.cpp8
-rwxr-xr-xplugin/mms_plugin/MmsPluginDecode.cpp5
-rwxr-xr-xplugin/mms_plugin/MmsPluginEncode.cpp4
-rwxr-xr-xutils/MsgUtilFile.cpp2
6 files changed, 27 insertions, 24 deletions
diff --git a/framework/storage-handler/MsgStorageMessage.cpp b/framework/storage-handler/MsgStorageMessage.cpp
index 9634904..3198002 100755
--- a/framework/storage-handler/MsgStorageMessage.cpp
+++ b/framework/storage-handler/MsgStorageMessage.cpp
@@ -1203,8 +1203,9 @@ msg_error_t MsgStoDeleteAllMessageInFolder(msg_folder_id_t folderId, bool bOnlyD
MSGFW_MMS_MULTIPART_TABLE_NAME);
if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ err = MSG_ERR_DB_PREPARE;
dbHandle->endTrans(false);
- return MSG_ERR_DB_PREPARE;
+ goto FREE_MEMORY;
}
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
@@ -1279,7 +1280,9 @@ msg_error_t MsgStoDeleteAllMessageInFolder(msg_folder_id_t folderId, bool bOnlyD
if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
- return MSG_ERR_DB_PREPARE;
+ err = MSG_ERR_DB_PREPARE;
+
+ goto FREE_MEMORY;
}
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
@@ -1354,18 +1357,17 @@ msg_error_t MsgStoDeleteAllMessageInFolder(msg_folder_id_t folderId, bool bOnlyD
/* Create thread for noti and phone log delete. */
if (!bOnlyDB) {
- if (pToDeleteMsgIdList->nCount > 0) {
- /* memory free */
- if (pToDeleteMsgIdList != NULL) {
- /*free peer info list */
- if (pToDeleteMsgIdList->msgIdList != NULL)
- delete [] pToDeleteMsgIdList->msgIdList;
-
- delete [] pToDeleteMsgIdList;
- }
-
+ if (pToDeleteMsgIdList->nCount > 0)
MsgRefreshAllNotification(true, false, MSG_ACTIVE_NOTI_TYPE_NONE);
- }
+ }
+
+ /* memory free */
+ if (pToDeleteMsgIdList != NULL) {
+ /*free peer info list */
+ if (pToDeleteMsgIdList->msgIdList != NULL)
+ delete [] pToDeleteMsgIdList->msgIdList;
+
+ delete [] pToDeleteMsgIdList;
}
return MSG_SUCCESS;
diff --git a/framework/transaction-manager/MsgTransManager.cpp b/framework/transaction-manager/MsgTransManager.cpp
index 5c22741..fc5bd6b 100755
--- a/framework/transaction-manager/MsgTransManager.cpp
+++ b/framework/transaction-manager/MsgTransManager.cpp
@@ -91,6 +91,10 @@ MsgIpcServerSocket MsgTransactionManager::servSock;
MsgTransactionManager::MsgTransactionManager() : running(false), mx(), mxQ(), cv(), eventQueue()
{
+ p_cynara = NULL;
+ client_method = CLIENT_METHOD_DEFAULT;
+ user_method = USER_METHOD_DEFAULT;
+
sentMsgMap.clear();
statusCBFdMap.clear();
newMsgCBList.clear();
diff --git a/manager/src/msg-manager-notification.cpp b/manager/src/msg-manager-notification.cpp
index 9ba4ed9..f1bc3ad 100644
--- a/manager/src/msg-manager-notification.cpp
+++ b/manager/src/msg-manager-notification.cpp
@@ -443,9 +443,6 @@ int MsgMgrAddReportNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_M
notification_h noti_h = NULL;
bool isNewNoti = false;
- report_notification_s *info = new report_notification_s;
- memset(info, 0x00, sizeof(report_notification_s));
-
MSG_MGR_NOTI_INFO_S noti_info = {0, };
noti_info.type = noti_type;
@@ -510,11 +507,6 @@ int MsgMgrAddReportNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_M
}
}
- info->priv_id = noti_info.id;
- snprintf(info->addressVal, sizeof(info->addressVal), "%s", msg_info->addressVal);
- msg_report_notification_list = g_list_append(msg_report_notification_list, (void *)info);
- MSG_MGR_SEC_DEBUG("appended list data = [priv_id = %d address = %s]", info->priv_id, info->addressVal);
-
__END_OF_ADD_REPORT_NOTI :
clearInfoData(noti_h, &noti_info);
diff --git a/plugin/mms_plugin/MmsPluginDecode.cpp b/plugin/mms_plugin/MmsPluginDecode.cpp
index 4f35fa3..6dbed34 100755
--- a/plugin/mms_plugin/MmsPluginDecode.cpp
+++ b/plugin/mms_plugin/MmsPluginDecode.cpp
@@ -502,6 +502,11 @@ bool MmsBinaryDecodeMsgHeader(FILE *pFile, int totalLength)
case MMS_CODE_FROM:
+ if (mmsHeader.pFrom != NULL) {
+ MSG_DEBUG("MMS_CODE_FROM is already decoded");
+ goto __CATCH;
+ }
+
/* Value-length (Address-present-token Encoded-string-value | Insert-address-token) */
if (__MmsDecodeValueLength(pFile, &valueLength, totalLength) <= 0) {
diff --git a/plugin/mms_plugin/MmsPluginEncode.cpp b/plugin/mms_plugin/MmsPluginEncode.cpp
index 1b535d6..84e7700 100755
--- a/plugin/mms_plugin/MmsPluginEncode.cpp
+++ b/plugin/mms_plugin/MmsPluginEncode.cpp
@@ -1426,13 +1426,13 @@ static int __MmsBinaryEncodeContentTypeLen(MsgType *pType)
length = __MmsBinaryEncodeTextStringLen((UINT8*)pszName);
+ g_free(pszName);
+
if (length == -1) {
MSG_DEBUG("szName MmsBinaryEncodeIntegerLen fail");
goto __CATCH;
}
- g_free(pszName);
-
totalLength += (length + 1);
}
}
diff --git a/utils/MsgUtilFile.cpp b/utils/MsgUtilFile.cpp
index c7e4b03..0915819 100755
--- a/utils/MsgUtilFile.cpp
+++ b/utils/MsgUtilFile.cpp
@@ -1269,7 +1269,7 @@ int MsgTcsScanFile(const char *filepath, int *bLevel)
ret = csr_cs_scan_file(csr_handle, filepath, &detected);
if (ret == CSR_ERROR_NONE) {
if (detected) {
- csr_cs_severity_level_e severity;
+ csr_cs_severity_level_e severity = CSR_CS_SEVERITY_LOW;
char *name = NULL;
ret = csr_cs_malware_get_severity(detected, &severity);