From 43a4c420366ae9ccd907fb0e0ce0f55ca9269081 Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Mon, 4 Jul 2022 17:03:13 +0900 Subject: [PATCH] fix memory leak Change-Id: I3d39dc16c44402ca13d48aeb6378c062d58c25bd --- app/AppActionLaunch.cpp | 3 +++ bluetooth/BtActionAudioConnect.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/app/AppActionLaunch.cpp b/app/AppActionLaunch.cpp index fff0781..ec92b23 100644 --- a/app/AppActionLaunch.cpp +++ b/app/AppActionLaunch.cpp @@ -84,9 +84,12 @@ void AppActionLaunch::undo() ERR("app_manager_get_app_context(%s) Fail(%s)", requestVal.c_str(), get_error_message(ret)); return; } + ret = app_manager_terminate_app(runAppContext); if (APP_MANAGER_ERROR_NONE != ret) ERR("app_manager_terminate_app() Fail(%s)", get_error_message(ret)); + + app_context_destroy(runAppContext); } std::string AppActionLaunch::getUndoInfo() diff --git a/bluetooth/BtActionAudioConnect.cpp b/bluetooth/BtActionAudioConnect.cpp index 9588948..70fffba 100644 --- a/bluetooth/BtActionAudioConnect.cpp +++ b/bluetooth/BtActionAudioConnect.cpp @@ -57,6 +57,7 @@ int BtActionAudioConnect::set(const std::string &val) DBG("BT device(%s) is not bonded", val.c_str()); } else { ERR("bt_adapter_get_bonded_device_info() Fail(%s)", get_error_message(ret)); + bt_adapter_free_device_info(devInfo); return MODES_ERROR_SYSTEM; } -- 2.34.1