summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2015-05-26 15:52:26 +0200
committerJiří Klimeš <jklimes@redhat.com>2015-05-26 16:07:30 +0200
commit3a193f7d3bc3ceccf6d8f5357c2641e267ebb544 (patch)
tree227e1dd47b5b27c46b7fa01e1d5b0d38d321207b
parent568ffe403008e1b1c99137458a076e08e43f2238 (diff)
downloadNetworkManager-3a193f7d3bc3ceccf6d8f5357c2641e267ebb544.tar.gz
libnm-glib: do not access NULL GError variable (rh #1224819)
dbus_g_proxy_call() should set GError if returning FALSE. But apparently there is a bug in dbus-glib and the error can be NULL. https://bugzilla.redhat.com/show_bug.cgi?id=1224819 (cherry picked from commit f46eb1fc2086fe0bb952da52c276a1b6ded868dc)
-rw-r--r--libnm-glib/nm-client.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index b7a1a826e4..73409dcdb8 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -782,8 +782,9 @@ nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active)
DBUS_TYPE_G_OBJECT_PATH, path,
G_TYPE_INVALID,
G_TYPE_INVALID)) {
- g_warning ("Could not deactivate connection '%s': %s", path, error->message);
- g_error_free (error);
+ g_warning ("Could not deactivate connection '%s': %s",
+ path, error ? error->message : "(unknown)");
+ g_clear_error (&error);
}
}
@@ -1094,8 +1095,9 @@ nm_client_networking_set_enabled (NMClient *client, gboolean enable)
G_TYPE_BOOLEAN, enable,
G_TYPE_INVALID,
G_TYPE_INVALID)) {
- g_warning ("Error enabling/disabling networking: %s", err->message);
- g_error_free (err);
+ g_warning ("Error enabling/disabling networking: %s",
+ err ? err->message : "(unknown)");
+ g_clear_error (&err);
}
}