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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user