fixed svace issue 40/128040/3 accepted/tizen/unified/20170510.013104 submit/tizen/20170508.100641 tizen_4.0.m1_release
authorIckhee Woo <ickhee.woo@samsung.com>
Thu, 4 May 2017 07:27:12 +0000 (16:27 +0900)
committerIckhee Woo <ickhee.woo@samsung.com>
Mon, 8 May 2017 09:23:58 +0000 (18:23 +0900)
Change-Id: I8544bd77340feb60425b29449d18ae5b48d351bf
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
packaging/sync-manager.spec
src/sync-service/SyncManager_RepositoryEngine.cpp
src/sync-service/SyncManager_SyncManager.cpp

index 178e09cc90c2d25cd366576674ab2f73a36d5753..076e4ddce72688199c1007f8eee1959dbb265886 100644 (file)
@@ -2,7 +2,7 @@
 %global __provides_exclude_from ^.*\\.extension-calendar
 
 Name:      sync-service
-Version:   0.1.22
+Version:   0.1.23
 Release:   1
 License:   Apache-2.0
 Summary:   Sync manager daemon
index 5d692273d383bb24944a6d6583a20cebd42c37f7..722647d7fc9074c72a5ffb9fce443fae89320c5f 100644 (file)
@@ -263,7 +263,7 @@ RepositoryEngine::CancelPackageSyncJobs(const char *PackageName) {
                                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;
index 14c63e69fe16bdc35eff108e8c1a029f1d6647e7..9e1d8f0f8fbcb04ffed184cd2a5d1dee0635b1b0 100644 (file)
@@ -948,13 +948,23 @@ SyncManager::GetSyncSupport(int accountId) {
        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 */