fix prevent issue
authorChangseok Oh <seok.oh@samsung.com>
Sat, 12 Jan 2013 06:34:53 +0000 (15:34 +0900)
committerChangseok Oh <seok.oh@samsung.com>
Sat, 12 Jan 2013 06:34:53 +0000 (15:34 +0900)
framework/main.cpp
framework/submit-handler/MsgSubmitHandler.cpp
framework/transaction-manager/MsgTransManager.cpp
msg_helper/MsgSoundPlayer.cpp
plugin/mms_plugin/MmsPluginDecode.cpp
proxy/MsgProxyListener.cpp
vobject-engine/VCard.c
vobject-engine/VMessage.c

index 5aa0baa..9773bac 100755 (executable)
@@ -328,7 +328,8 @@ void* InitMsgServer(void*)
        }
 
        // Set Msg FW Ready Flag
-       MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true);
+       if(MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true) != MSG_SUCCESS)
+               MSG_DEBUG("MsgSettingSetBool FAIL : VCONFKEY_MSG_SERVER_READY");
        MSG_DEBUG("### VCONFKEY_MSG_SERVER_READY ###");
 
        if (plg == NULL) {
@@ -432,7 +433,8 @@ signal( SIGCHLD, SIG_IGN );
        MSG_DEBUG("===========START MESSAGING FRAMEWORK==========");
 
        // Reset message server ready flag
-       MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, false);
+       if(MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, false) != MSG_SUCCESS)
+               MSG_DEBUG("MsgSettingSetBool FAIL: VCONFKEY_MSG_SERVER_READY");
 
        // Connect to DB
        //      MsgStoConnectDB();
index 105a04c..67964f7 100755 (executable)
@@ -134,7 +134,7 @@ msg_error_t MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo)
                MSG_DEBUG("JAVA MMS PDU filepath:%s", pReqInfo->msgInfo.msgData);
 
                // submit request
-               plg->submitReq(pReqInfo);
+               err = plg->submitReq(pReqInfo);
 
                if(err != MSG_SUCCESS)
                {
index 38cc69b..5ff2cef 100755 (executable)
@@ -676,7 +676,8 @@ void MsgTransactionManager::setCBMsgCB(MSG_CMD_REG_INCOMING_CB_MSG_CB_S *pCbInfo
        }
 
        if(pCbInfo->bsave)
-               MsgSettingSetBool(CB_SAVE, pCbInfo->bsave);
+               if(MsgSettingSetBool(CB_SAVE, pCbInfo->bsave) != MSG_SUCCESS)
+                       MSG_DEBUG("MsgSettingSetBool FAIL: CB_SAVE");
 
 
        newCBMsgCBList.push_back(*pCbInfo);
index af754a6..a9a747f 100755 (executable)
@@ -305,17 +305,10 @@ int MsgSoundPlayMelody(char *pMsgToneFilePath, bool bIncreasing)
 {
        int err = MM_ERROR_NONE;
 
-       /* Setting fade in,out */
-       err = mm_player_set_attribute(hPlayerHandle, NULL, "sound_priority", 2, NULL);
-
-       if (err != MM_ERROR_NONE) {
-               MSG_DEBUG("error setting the profile attr");
-               return err;
-       }
-
-       /* Setting the Volume */
+       /* Setting fade in/out, Volume */
        err = mm_player_set_attribute(hPlayerHandle, NULL, "sound_volume_type", MM_SOUND_VOLUME_TYPE_NOTIFICATION,
-                                                                                                       "profile_uri", pMsgToneFilePath, strlen(pMsgToneFilePath), NULL);
+                                                                                                       "profile_uri", pMsgToneFilePath, strlen(pMsgToneFilePath),
+                                                                                                       "sound_priority", 2, NULL);
 
        if (err != MM_ERROR_NONE) {
                MSG_DEBUG("error setting the profile attr");
index decd4d7..0d24ece 100755 (executable)
@@ -2184,13 +2184,15 @@ static bool __MmsBinaryDecodeMultipart(FILE *pFile, char *szFilePath, MsgType *p
                if (pMsgBody->body.pMultipart == NULL) {
                        /* first multipart */
                        pMsgBody->body.pMultipart = pMultipart;
-                       pLastMultipart                    = pMultipart;
-                       pPreMultipart                     = NULL;
-               } else if (pLastMultipart != NULL) {
-                       pPreMultipart = pLastMultipart;
+               }
 
-                       pLastMultipart->pNext   = pMultipart;
-                       pLastMultipart                  = pMultipart;
+               if (pLastMultipart == NULL) {
+                       /* first multipart */
+                       pLastMultipart = pMultipart;
+                       pPreMultipart = NULL;
+               } else {
+                       pLastMultipart->pNext = pMultipart;
+                       pLastMultipart = pMultipart;
                        pPreMultipart = pMultipart;
                }
 
@@ -2440,7 +2442,8 @@ static bool __MmsBinaryDecodeDRMContent(FILE *pFile, char *szFilePath, MsgType *
                }
        }
 
-       remove(szTempFilePath);
+       if(remove(szTempFilePath) != 0)
+               MSG_DEBUG("remove fail");
        isFileCreated = false;
 
        if (__MmsBinaryDecodeMovePointer(pFile, offset + bodyLength, totalLength) == false)
index 2fa85ff..70d640d 100755 (executable)
@@ -559,7 +559,8 @@ void MsgProxyListener::clearListOfClosedHandle(MsgHandle* pMsgHandle)
        }
 
        if(!bSave)
-               MsgSettingSetBool(CB_SAVE, bSave);
+               if(MsgSettingSetBool(CB_SAVE, bSave) != MSG_SUCCESS)
+                       MSG_DEBUG("MsgSettingSetBool FAIL: CB_SAVE");
 
        // Storage change Message CB list
        std::list<MSG_STORAGE_CHANGE_CB_ITEM_S>::iterator it8 = storageChangeCBList.begin();
index 1790789..ffdbe14 100755 (executable)
@@ -1342,7 +1342,8 @@ __VCardTypeEncode( VObject *pTypeObj, char *pType )
                        VDATA_TRACE_END
                        return NULL;
                }
-               _VQPEncode( pRes, pEncode );
+               if(pEncode)
+                       _VQPEncode( pRes, pEncode );
                VFREE(pEncode);
                        }
        else if(enc & pEncList[1].flag ) {
index c223119..e6b8b2a 100755 (executable)
@@ -1189,6 +1189,7 @@ vmsg_encode( VTree *pVMsgRaw )
                                        if (encoded == NULL) {
                                                VDATA_TRACE(  "vcard_encode() failed\n");
                                                VFREE(pTemp);
+                                               VFREE(pVMsgRes);
                                                VDATA_TRACE_END
                                                return NULL;
                                        }
@@ -1210,6 +1211,7 @@ vmsg_encode( VTree *pVMsgRaw )
                                        VDATA_TRACE("pTemp : %s", encoded);
                                        VFREE( pTemp );
                                        VFREE( encoded );
+                                       VFREE(pVMsgRes);
                                        break;
                                }
                                else
@@ -1431,7 +1433,8 @@ __VMsgTypeEncode( VObject *pTypeObj, char *pType )
                        VDATA_TRACE_END
                        return NULL;
                }
-               _VQPEncode( pRes, pEncode );
+               if(pEncode)
+                       _VQPEncode( pRes, pEncode );
                VFREE(pEncode);
                        }
        else if(enc & pMsgEncList[1].flag )