summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2020-10-27 17:41:29 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2020-10-27 17:47:15 +0900
commit016cb0097f6ab02a74544be6699bffdbe78e856f (patch)
tree0fbcc4663ee9ad1fb28d12c1d02fa5adc05dfd7f
parent8d83ea46ac20e38e3191e64b8512a754d7637e76 (diff)
downloadnotification-016cb0097f6ab02a74544be6699bffdbe78e856f.tar.gz
notification-016cb0097f6ab02a74544be6699bffdbe78e856f.tar.bz2
notification-016cb0097f6ab02a74544be6699bffdbe78e856f.zip
Fix memory leak
Change-Id: I652c07d13faef7ee237afdb9e886151fd9f41902 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--notification-ex/app_control_action.cc3
-rw-r--r--notification-ex/dbus_sender.cc4
2 files changed, 6 insertions, 1 deletions
diff --git a/notification-ex/app_control_action.cc b/notification-ex/app_control_action.cc
index 9c6f552..eaa6ba2 100644
--- a/notification-ex/app_control_action.cc
+++ b/notification-ex/app_control_action.cc
@@ -123,6 +123,9 @@ void AppControlAction::Deserialize(Bundle b) {
return;
}
+ if (impl_->control_)
+ app_control_destroy(impl_->control_);
+
impl_->control_ = app_control;
}
diff --git a/notification-ex/dbus_sender.cc b/notification-ex/dbus_sender.cc
index cb42df3..72a4b08 100644
--- a/notification-ex/dbus_sender.cc
+++ b/notification-ex/dbus_sender.cc
@@ -149,11 +149,13 @@ std::list<Bundle> DBusSender::Request(const IEventInfo& info) {
list<Bundle> ret_list;
g_variant_get(reply_body, "(a(s))", &iter);
char* raw = nullptr;
- while (g_variant_iter_loop(iter, "(s)", &raw) && raw != nullptr) {
+ while (g_variant_iter_loop(iter, "(&s)", &raw) && raw != nullptr) {
Bundle ret(raw);
ret_list.emplace_back(ret);
}
+ if (iter)
+ g_variant_iter_free(iter);
return ret_list;
}