summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sync-service/SyncManager_RepositoryEngine.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sync-service/SyncManager_RepositoryEngine.cpp b/src/sync-service/SyncManager_RepositoryEngine.cpp
index e2b16f0..7ed6243 100644
--- a/src/sync-service/SyncManager_RepositoryEngine.cpp
+++ b/src/sync-service/SyncManager_RepositoryEngine.cpp
@@ -1946,11 +1946,17 @@ RepositoryEngine::UpdateSyncJobToDB(const char *SvcAppId, int UserId, const char
char *update_query = NULL;
string SvcPkgId = SyncManager::GetInstance()->GetPkgIdByAppId(SvcAppId);
+ char *svc_pkg_id = new char[SvcPkgId.size() + 1];
+ copy(SvcPkgId.begin(), SvcPkgId.end(), svc_pkg_id);
+ svc_pkg_id[SvcPkgId.size() + 1] = '\0';
+
update_query = sqlite3_mprintf("UPDATE %Q SET AppStatus=%Q, SyncJobId=%Q, AccountId=%Q, Interval=%Q, "
"Expedit=%Q, NoRetry=%Q, UserDataKey=%Q, UserDataValue=%Q "
"WHERE SvcAppId=%Q AND PkgName=%Q AND UserId=%Q AND SyncType=%Q AND JobName=%Q",
SYNC_JOB_TABLE, AppStatus, jobId, accId, interval, expedit, noRetry, UserKey, UserValue,
- SvcAppId, SvcPkgId.c_str(), uid, SyncType, JobName);
+ SvcAppId, svc_pkg_id, uid, SyncType, JobName);
+
+ delete[] svc_pkg_id;
sqlite3_stmt *stmt = NULL;
int ret = SQLITE_OK;