summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2020-10-30 14:32:32 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2020-10-30 14:32:56 +0900
commit53528fd0f0e40bb154134d6c781142e0cd4b7575 (patch)
tree8268b6793228e2a2fb61f277cf33c8c0e77f75a4
parente8e7576bb0fc12e08a17689b104b7aed1f96c96d (diff)
downloadnotification-53528fd0f0e40bb154134d6c781142e0cd4b7575.tar.gz
notification-53528fd0f0e40bb154134d6c781142e0cd4b7575.tar.bz2
notification-53528fd0f0e40bb154134d6c781142e0cd4b7575.zip
Fix memory leak related to gdbus method call
Change-Id: Icc033e8e51590ea7ffe06548dec0635398217aa4 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--notification-ex/dbus_sender.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/notification-ex/dbus_sender.cc b/notification-ex/dbus_sender.cc
index 72a4b08..9d6bcdb 100644
--- a/notification-ex/dbus_sender.cc
+++ b/notification-ex/dbus_sender.cc
@@ -130,7 +130,7 @@ GDBusMessage* DBusSender::Impl::MethodCall(string appid, string method_name,
GDBusMessage* reply = g_dbus_connection_send_message_with_reply_sync(
DBusConnectionManager::GetInst().GetConnection(), msg,
G_DBUS_SEND_MESSAGE_FLAGS_NONE, -1, NULL, NULL, &err);
-
+ g_object_unref(msg);
return reply;
}
@@ -156,6 +156,8 @@ std::list<Bundle> DBusSender::Request(const IEventInfo& info) {
if (iter)
g_variant_iter_free(iter);
+ if (reply)
+ g_object_unref(reply);
return ret_list;
}
@@ -172,6 +174,8 @@ int DBusSender::RequestNumber(const IEventInfo& info) {
int num;
g_variant_get(reply_body, "(i)", &num);
+ if (reply)
+ g_object_unref(reply);
return num;
}