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);
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)
{