[PATCH 02/10] daemon: fix memleak in queue_changed_property

Peter Wu peter at lekensteyn.nl
Wed Nov 26 03:21:09 PST 2014


The control of value is transferred to up_daemon_queue_changed_property,
let it release the memory when an error occurs.

https://bugs.freedesktop.org/show_bug.cgi?id=82659
---
 src/up-daemon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/up-daemon.c b/src/up-daemon.c
index eb12c36..63ea7d1 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -662,8 +662,10 @@ up_daemon_queue_changed_property (UpDaemon    *daemon,
 {
 	g_return_if_fail (UP_IS_DAEMON (daemon));
 
-	if (daemon->priv->connection == NULL)
+	if (daemon->priv->connection == NULL) {
+		g_variant_unref (value);
 		return;
+	}
 
 	if (!daemon->priv->changed_props) {
 		daemon->priv->changed_props = g_hash_table_new_full (g_str_hash, g_str_equal,
-- 
2.1.3



More information about the devkit-devel mailing list