From 3712e3981b2056401c57c981160c96ff931f612c Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 11 Mar 2011 14:48:19 +0100
Subject: Bug #644301 - Invalid GVariant format in NetworkManager module

---
 modules/connman/evolution-connman.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'modules/connman')

diff --git a/modules/connman/evolution-connman.c b/modules/connman/evolution-connman.c
index 10a6fad295..50b5cf37fb 100644
--- a/modules/connman/evolution-connman.c
+++ b/modules/connman/evolution-connman.c
@@ -111,7 +111,7 @@ connman_check_initial_state (EConnMan *extension)
 		extension->connection, message,
 		G_DBUS_SEND_MESSAGE_FLAGS_NONE, 100, NULL, NULL, &error);
 
-	if (response != NULL) {
+	if (response != NULL && !g_dbus_message_to_gerror (response, &error)) {
 		gchar *state = NULL;
 		GVariant *body = g_dbus_message_get_body (response);
 
@@ -122,6 +122,8 @@ connman_check_initial_state (EConnMan *extension)
 		g_warning ("%s: %s", G_STRFUNC, error ? error->message : "Unknown error");
 		if (error)
 			g_error_free (error);
+		if (response)
+			g_object_unref (response);
 		g_object_unref (message);
 		return;
 	}
-- 
cgit v1.2.3