[PATCH 2/2] Fix leak of dbus message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 test/mpris-player.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/test/mpris-player.c b/test/mpris-player.c
index 9e63b4b..29bea46 100644
--- a/test/mpris-player.c
+++ b/test/mpris-player.c
@@ -122,6 +122,7 @@ static dbus_bool_t emit_property_changed(DBusConnection *conn,
 {
 	DBusMessage *signal;
 	DBusMessageIter iter;
+	dbus_bool_t result;
 
 	signal = dbus_message_new_signal(path, interface, "PropertyChanged");
 
@@ -137,7 +138,10 @@ static dbus_bool_t emit_property_changed(DBusConnection *conn,
 
 	append_variant(&iter, type, value);
 
-	return dbus_connection_send(conn, signal, NULL);
+	result = dbus_connection_send(conn, signal, NULL);
+	dbus_message_unref(signal);
+
+	return result;
 }
 
 static int parse_property(DBusConnection *conn, const char *path,
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux