Fix : Memory leak for 'app_context' 93/287793/1 accepted/tizen_7.0_unified tizen_7.0 accepted/tizen/7.0/unified/20230208.184450 accepted/tizen/7.0/unified/20230208.231217 accepted/tizen/7.0/unified/20230208.231236
authorDewal Agarwal <d1.agarwal@samsung.com>
Mon, 26 Dec 2022 13:32:37 +0000 (19:02 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 6 Feb 2023 09:13:35 +0000 (09:13 +0000)
- Coverity CID : 1281674

Change-Id: Ie18eb7ec90005079c26bbe7d98019e47c6398af6
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
(cherry picked from commit f9b8c50e43160549dd8d9a33aa125d5b56004438)

src/sync-service/SyncManager_SyncService.cpp

index 2ac2f8e937c2203634e561b8aba551ca89510373..508c57c670824b2e443865c1120529f27c42dcfb 100644 (file)
@@ -392,6 +392,7 @@ SyncService::TriggerStartSync(const char* appId, int uid, int accountId, const c
                                SYNC_LOGE_RET_RES(ret == APP_MANAGER_ERROR_NONE, SYNC_ERROR_SYSTEM, "getting app_context is failed");
 
                                ret = app_context_get_pid(app_context, &pid);
+                               SYNC_LOG_IF((0 != app_context_destroy(app_context)), "app_context_destroy() failed");
                                SYNC_LOGE_RET_RES(ret == APP_MANAGER_ERROR_NONE, SYNC_ERROR_SYSTEM, "getting pid from app_context is failed");
 
                                snprintf(object_path, sizeof(object_path) - 1, "%s/%d", SYNC_ADAPTER_DBUS_PATH, pid);