From: Hwankyu Jhun Date: Tue, 27 Oct 2020 08:41:29 +0000 (+0900) Subject: Fix memory leak X-Git-Tag: submit/tizen/20201028.051031~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fdccca015d4f81c4c61b0ae9ee3d5f5eba227e9;p=platform%2Fcore%2Fapi%2Fnotification.git Fix memory leak Change-Id: I652c07d13faef7ee237afdb9e886151fd9f41902 Signed-off-by: Hwankyu Jhun --- diff --git a/notification-ex/app_control_action.cc b/notification-ex/app_control_action.cc index 9c6f5520..eaa6ba24 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 88ddbec7..b41f384c 100644 --- a/notification-ex/dbus_sender.cc +++ b/notification-ex/dbus_sender.cc @@ -252,11 +252,13 @@ std::list DBusSender::Request(const IEventInfo& info) { GVariantIter *iter = nullptr; 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; }