xmlChar* pPackageId;
pPackageId = xmlGetProp(cur, XML_ATTR_PACKAGE_ID);
- if (!strcmp((char*)pPackageId, PackageName)) {
+ if (pPackageId != NULL && !strcmp((char*)pPackageId, PackageName)) {
xmlNodePtr curJob = cur->xmlChildrenNode;
while (curJob != NULL) {
xmlChar* pSyncJobId;
LOG_LOGE_BOOL(ret == ACCOUNT_ERROR_NONE, "account access failed [%d]", ret);
KNOX_CONTAINER_ZONE_ENTER(GetAccountPid(accountId));
- ret = account_query_account_by_account_id(accountId, &accountHandle);
+ ret = account_query_account_by_account_id(accountId, &accountHandle);
KNOX_CONTAINER_ZONE_EXIT();
- LOG_LOGE_BOOL(ret == ACCOUNT_ERROR_NONE, "account query failed [%d]", ret);
+ if (ret != ACCOUNT_ERROR_NONE) {
+ LOG_LOGD("account query failed [%d]", ret);
+ account_destroy(accountHandle);
+ return false;
+ }
account_sync_state_e syncSupport;
- ret = account_get_sync_support(accountHandle, &syncSupport);
- LOG_LOGE_BOOL(ret == ACCOUNT_ERROR_NONE, "account access failed [%d]", ret);
+ ret = account_get_sync_support(accountHandle, &syncSupport);
+ if (ret != ACCOUNT_ERROR_NONE) {
+ LOG_LOGD("account access failed [%d]", ret);
+ account_destroy(accountHandle);
+ return false;
+ }
+
+ account_destroy(accountHandle);
if (syncSupport == ACCOUNT_SYNC_INVALID || syncSupport == ACCOUNT_SYNC_NOT_SUPPORT) {
LOG_LOGD("The account does not support sync"); /* LCOV_EXCL_LINE */