DoCoMo DCM-1122
authorByounghui <byounghui.lim@samsung.com>
Fri, 29 Mar 2013 12:14:42 +0000 (21:14 +0900)
committerByounghui <byounghui.lim@samsung.com>
Fri, 29 Mar 2013 12:29:06 +0000 (21:29 +0900)
fixed.

Change-Id: I07a96d1cb62c9d30e19d1253dad17ac4da8caa90
Signed-off-by: Byounghui <byounghui.lim@samsung.com>
src/FMsg_WapPushManagerImpl.cpp

index 24a9813..1c350f5 100644 (file)
@@ -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)
        {