diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-05-26 15:52:26 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-05-26 15:59:11 +0200 |
commit | f46eb1fc2086fe0bb952da52c276a1b6ded868dc (patch) | |
tree | cc111766278ce5bd9b3f0b77ea0d34f8da688ea5 | |
parent | ce3d1533cc9aaed14bfa8c03fe66365f2dc1e352 (diff) | |
download | NetworkManager-f46eb1fc2086fe0bb952da52c276a1b6ded868dc.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
-rw-r--r-- | libnm-glib/nm-client.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index d62a8b6320..40add09c76 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); } } |