All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gdbus: Always unreference the message in g_dbus_send_message()
@ 2013-02-08 13:58 Tomasz Bursztyka
  2013-02-23 10:48 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Bursztyka @ 2013-02-08 13:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, Tomasz Bursztyka

---

Hi,

A quick fix on g_dbus_send_message(), if check_signal() fails it returns FALSE without unreferencing
the message as it should. This patch fixes it.

 gdbus/object.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index 0c11246..ba8be94 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1496,7 +1496,7 @@ DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...)
 
 gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
 {
-	dbus_bool_t result;
+	dbus_bool_t result = FALSE;
 
 	if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
 		dbus_message_set_no_reply(message, TRUE);
@@ -1507,11 +1507,12 @@ gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
 		const GDBusArgInfo *args;
 
 		if (!check_signal(connection, path, interface, name, &args))
-			return FALSE;
+			goto out;
 	}
 
 	result = dbus_connection_send(connection, message, NULL);
 
+out:
 	dbus_message_unref(message);
 
 	return result;
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdbus: Always unreference the message in g_dbus_send_message()
  2013-02-08 13:58 [PATCH] gdbus: Always unreference the message in g_dbus_send_message() Tomasz Bursztyka
@ 2013-02-23 10:48 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2013-02-23 10:48 UTC (permalink / raw)
  To: Tomasz Bursztyka; +Cc: linux-bluetooth, luiz.dentz

Hi Tomasz,

On Fri, Feb 08, 2013, Tomasz Bursztyka wrote:
> ---
> 
> Hi,
> 
> A quick fix on g_dbus_send_message(), if check_signal() fails it returns FALSE without unreferencing
> the message as it should. This patch fixes it.
> 
>  gdbus/object.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Thanks. Applied, though I had to move the comment part into the actual
commit message.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-23 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08 13:58 [PATCH] gdbus: Always unreference the message in g_dbus_send_message() Tomasz Bursztyka
2013-02-23 10:48 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.