LOG_LOGD("Received start sync request in sync adapter: params account[%d] jobname [%s] Data sync [%s]", accountId, pSyncJobName, is_data_sync ? "YES" : "NO");
char *command_line = proc_get_cmdline_self();
+ if (command_line == NULL)
+ return false;
if (!g_sync_adapter) {
LOG_LOGD("Sync adapter is already released");
+ free(command_line);
return false;
}
if (g_sync_adapter->__syncRunning) {
LOG_LOGD("Sync already running");
tizen_sync_adapter_call_send_result_sync(pObject, command_line, (int)SYNC_STATUS_SYNC_ALREADY_IN_PROGRESS, pSyncJobName, NULL, NULL);
+ free(command_line);
return true;
}
if (g_strcmp0(_sync_errors[i].dbus_error_name, remote_error) == 0) {
LOG_LOGD("Remote error code matched [%d]", _sync_errors[i].error_code);
g_free(remote_error);
+ remote_error = NULL;
return _sync_errors[i].error_code;
}
}
}
+ if (remote_error)
+ g_free(remote_error);
}
/* All undocumented errors mapped to SYNC_ERROR_UNKNOWN */
return SYNC_ERROR_UNKNOWN;
CurrentSyncJobQueue::ToKey(account_h account, string capability) {
int ret = ACCOUNT_ERROR_NONE;
string key;
- char* pName;
+ char* pName = NULL;
int id;
stringstream ss;
ss << id;
key.append("id:").append(ss.str()).append("name:").append(pName).append("capability:").append(capability.c_str());
+ if (pName)
+ free(pName);
return key;
}
while (cur != NULL) {
if (!xmlStrcmp(cur->name, XML_NODE_SYNCADAPTER)) {
xmlChar* pServiceAppId = xmlGetProp(cur, XML_ATTR_SYNCADAPTER_SERVICE_APP_ID);
+ if (pServiceAppId == NULL) {
+ LOG_LOGD("Found empty service_app_id while parsing syncadapters.xml");
+ xmlFreeDoc(doc);
+ return;
+ }
+
xmlChar* pPackageId = xmlGetProp(cur, XML_ATTR_PACKAGE_ID);
+ if (pPackageId == NULL) {
+ LOG_LOGD("Found empty package_id while parsing syncadapters.xml");
+ xmlFreeDoc(doc);
+ return;
+ }
+
xmlChar* pAppStatus = xmlGetProp(cur, XML_ATTR_APP_STATUS);
+ if (pAppStatus == NULL)
+ LOG_LOGD("Found empty app_status while parsing syncadapters.xml");
pkgmgrinfo_appinfo_h handle_appinfo;
if (pkgmgrinfo_appinfo_get_appinfo((char*)pServiceAppId, &handle_appinfo) == PMINFO_R_OK) {
} else {
pAggregator->HandlePackageUninstalled((char*)pPackageId);
}
-
- if (pServiceAppId)
- xmlFree(pServiceAppId);
- if (pPackageId)
- xmlFree(pPackageId);
+ xmlFree(pServiceAppId);
+ xmlFree(pPackageId);
if (pAppStatus)
xmlFree(pAppStatus);
}
isEqual = false;
}
- char* pName1;
- char* pName2;
+ char* pName1 = NULL;
+ char* pName2 = NULL;
if (account_get_user_name(account1, &pName1) < 0) {
isEqual = false;
}
if (id1 == id2 && strcmp(pName1, pName2) == 0) {
isEqual = true;
}
-
+ if (pName1) {
+ free(pName1);
+ pName1 = NULL;
+ }
+ if (pName2) {
+ free(pName2);
+ pName2 = NULL;
+ }
return isEqual;
}
/* LCOV_EXCL_STOP */
}
+ ret = SYNC_ERROR_NONE;
int sync_job_id = 0;
if (!pkgIdStr.empty()) {
LOG_LOGD("Params acc[%d] name[%s] option[%d] package[%s]", accountId, pSyncJobName, sync_option, pkgIdStr.c_str());
/* LCOV_EXCL_STOP */
}
+ ret = SYNC_ERROR_NONE;
if (!pkgIdStr.empty()) {
LOG_LOGD("package id [%s]", pkgIdStr.c_str());
ret = SyncManager::GetInstance()->RemoveSyncJob(pkgIdStr, atoi((char*)uid), sync_job_id);
/* LCOV_EXCL_STOP */
}
+ ret = SYNC_ERROR_NONE;
bundle *pBundle = NULL;
int sync_job_id = 0;
if (!pkgIdStr.empty()) {