From 2cf07634b2d8db329055d3b9c987695e3154df60 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Thu, 14 Feb 2019 20:04:56 +0900 Subject: [PATCH] kdbus: Fix memory leakage in capture_org_freedesktop_DBus_StartServiceByName() Change-Id: If4b04d0f287e199e809cdf183ce4ce779c0f4dd4 Signed-off-by: sanghyeok.oh --- dbus/dbus-transport-kdbus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index e9b0035..626c2a7 100755 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -2367,7 +2367,11 @@ capture_org_freedesktop_DBus_StartServiceByName (DBusTransportKdbus *transport, dbus_message_lock (sub_message); - if (kdbus_write_msg_internal (transport, sub_message, name, NULL, FALSE) == -1) + ret = kdbus_write_msg_internal (transport, sub_message, name, NULL, FALSE); + + dbus_message_unref (sub_message); + + if (ret == -1) return NULL; else { @@ -4004,7 +4008,7 @@ kdbus_do_iteration (DBusTransport *transport, * error messages are inserted directly to incoming queue and * application hangs on dbus_poll. * - * This causes a busy loop in _dbus_connection_block_pending_call() + * This causes a busy loop in _dbus_connection_block_pending_call() * There is no case of waiting for the locally-generated error reply if (_dbus_connection_get_n_incoming (transport->connection) > 0) -- 2.7.4