kdbus: Fix memory leakage in capture_org_freedesktop_DBus_StartServiceByName() 50/199750/3 accepted/tizen/unified/20190219.154258 submit/tizen/20190215.045528
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Thu, 14 Feb 2019 11:04:56 +0000 (20:04 +0900)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Thu, 14 Feb 2019 11:08:56 +0000 (20:08 +0900)
Change-Id: If4b04d0f287e199e809cdf183ce4ce779c0f4dd4
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
dbus/dbus-transport-kdbus.c

index e9b0035..626c2a7 100755 (executable)
@@ -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)