From a8c1992ba5cbb03c5bf24f432e91b565a5b0453c Mon Sep 17 00:00:00 2001 From: Daehyeon Jung Date: Mon, 16 Sep 2019 16:03:04 +0900 Subject: [PATCH] Fix static analysis issues Change-Id: I40705944baace152b3093cae7ca280b0df149ddb --- src/client.cc | 2 ++ src/unit_tests/unit_test.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.cc b/src/client.cc index 6dbd7f3..225ab34 100644 --- a/src/client.cc +++ b/src/client.cc @@ -475,6 +475,7 @@ void capmgr_dbus_callback(GVariant* result, void* user_data) { if (!reply->b) { LOG(ERROR) << "Invalid bundle data!"; capmgr_app_control_destroy(cbdata->request); + g_free(data); delete cbdata; return; } @@ -485,6 +486,7 @@ void capmgr_dbus_callback(GVariant* result, void* user_data) { cbdata->user_data); capmgr_app_control_destroy(cbdata->request); + g_free(data); delete cbdata; } diff --git a/src/unit_tests/unit_test.cc b/src/unit_tests/unit_test.cc index f6d53d6..955c154 100644 --- a/src/unit_tests/unit_test.cc +++ b/src/unit_tests/unit_test.cc @@ -46,8 +46,8 @@ int ApplicationForeachCb(const capmgr_app_info_h remote_app_info, char* appid; capmgr_app_info_get_appid(remote_app_info, &appid); - free(appid); LOG(INFO) << appid; + free(appid); return 0; } -- 2.7.4