From 3c24315dc3c53bea9230daa99c9b4c8c38779c39 Mon Sep 17 00:00:00 2001 From: chakradhar Date: Sat, 16 Feb 2019 20:55:45 +0530 Subject: svace issues Change-Id: I552c95ec8c1da4ec5fe9062a47cbaeb90339cd05 --- utils/MsgUtilFile.cpp | 2 +- utils/MsgUtilStorage.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/utils/MsgUtilFile.cpp b/utils/MsgUtilFile.cpp index c748e0e..7285d6e 100755 --- a/utils/MsgUtilFile.cpp +++ b/utils/MsgUtilFile.cpp @@ -355,7 +355,7 @@ bool MsgCreateFileName(char *pFileName) bool MsgOpenAndReadFile(const char *pFileName, char **ppData, int *pDataSize) { if (!pFileName || !ppData || !pDataSize) { - MSG_ERR("Invalid params!! pFileName=%s, ppData=%s, pDataSize=%p", pFileName, *ppData, (void *)pDataSize); + MSG_ERR("Invalid params"); return false; } diff --git a/utils/MsgUtilStorage.cpp b/utils/MsgUtilStorage.cpp index 0f2e607..b025f95 100755 --- a/utils/MsgUtilStorage.cpp +++ b/utils/MsgUtilStorage.cpp @@ -1319,6 +1319,16 @@ msg_error_t MsgStoSetConversationDisplayName(MsgDbHandler *pDbHandle, msg_thread memset(sqlQuery, 0x00, sizeof(sqlQuery)); snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET DISPLAY_NAME = ? WHERE CONV_ID = %d;", MSGFW_CONVERSATION_TABLE_NAME, convId); + + for (int j = 0; j < addressList.nCount; j++) { + msg_struct_s *pStruct = (msg_struct_s *)addressList.msg_struct_info[j]; + delete (MSG_ADDRESS_INFO_S *)pStruct->data; + delete (msg_struct_s *)pStruct; + } + + if (addressList.msg_struct_info != NULL) { + g_free((msg_struct_t *)addressList.msg_struct_info); + } if (pDbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) { MSG_DEBUG("Query Failed [%s]", sqlQuery); @@ -1335,16 +1345,6 @@ msg_error_t MsgStoSetConversationDisplayName(MsgDbHandler *pDbHandle, msg_thread pDbHandle->finalizeQuery(); - for (int j = 0; j < addressList.nCount; j++) { - msg_struct_s *pStruct = (msg_struct_s *)addressList.msg_struct_info[j]; - delete (MSG_ADDRESS_INFO_S *)pStruct->data; - delete (msg_struct_s *)pStruct; - } - - if (addressList.msg_struct_info != NULL) { - g_free((msg_struct_t *)addressList.msg_struct_info); - } - return err; } -- cgit v1.2.3