From 15ad7ebf9c727d018901160788e2a8c30c32b49d Mon Sep 17 00:00:00 2001 From: Byounghui Date: Fri, 29 Mar 2013 21:14:42 +0900 Subject: [PATCH] DoCoMo DCM-1122 fixed. Change-Id: I07a96d1cb62c9d30e19d1253dad17ac4da8caa90 Signed-off-by: Byounghui --- src/FMsg_WapPushManagerImpl.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/FMsg_WapPushManagerImpl.cpp b/src/FMsg_WapPushManagerImpl.cpp index 24a9813..1c350f5 100644 --- a/src/FMsg_WapPushManagerImpl.cpp +++ b/src/FMsg_WapPushManagerImpl.cpp @@ -185,13 +185,15 @@ _WapPushManagerImpl::RegisterCondition(const Tizen::Base::String& wapApplication SysTryCatch(NID_MSG, pContentType != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed"); err = app_get_package(&pPkgName); - SysTryCatch(NID_MSG, err == APP_ERROR_NONE, r = E_SYSTEM, r, "[%s] Failed to Open Message Handle", GetErrorMessage(r)); + SysTryCatch(NID_MSG, err == APP_ERROR_NONE && pPkgName != null, r = E_SYSTEM, r, "[%s] Failed to Open Message Handle", GetErrorMessage(r)); pushInfo = msg_create_struct(MSG_STRUCT_PUSH_CONFIG_INFO); + SysTryCatch(NID_MSG, pushInfo != null, r = E_SYSTEM, r, "[%s] Failed to create push data info", GetErrorMessage(r)); msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_CONTENT_TYPE_STR, (char *)pContentType, MAX_WAPPUSH_CONTENT_TYPE_LEN); msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_APPLICATON_ID_STR, (char *)pWapAppId, MAX_WAPPUSH_ID_LEN); msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_PACKAGE_NAME_STR, pPkgName, MSG_FILEPATH_LEN_MAX); free(pPkgName); + pPkgName = null; err = msg_add_push_event(__msgHandle, pushInfo); msg_release_struct(&pushInfo); @@ -213,8 +215,17 @@ _WapPushManagerImpl::RegisterCondition(const Tizen::Base::String& wapApplication return r; CATCH: - free(pPkgName); - msg_release_struct(&pushInfo); + if (pPkgName) + { + free(pPkgName); + pPkgName = null; + } + + if (pushInfo) + { + msg_release_struct(&pushInfo); + pushInfo = null; + } if (pWapAppId) { -- 2.7.4