libnm-glib: avoid coverity warning
authorThomas Haller <thaller@redhat.com>
Thu, 25 Jun 2015 15:52:25 +0000 (17:52 +0200)
committerThomas Haller <thaller@redhat.com>
Thu, 25 Jun 2015 16:17:19 +0000 (18:17 +0200)
  5. NetworkManager-1.0.3/libnm-glib/nm-remote-settings.c:493: var_compare_op: Comparing "error" to null implies that "error" might be null.
  8. NetworkManager-1.0.3/libnm-glib/nm-remote-settings.c:508: var_deref_op: Dereferencing null pointer "error".
  #   506|    g_hash_table_remove (priv->pending, path);
  #   507|
  #   508|->  if (print_once && error->code == DBUS_GERROR_LIMITS_EXCEEDED) {
  #   509|    g_printerr ("Warning: libnm-glib:%s(): a D-Bus limit exceeded: %s. The application might not work properly.\n"
  #   510|                "Consider increasing max_replies_per_connection limit in /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf "

libnm-glib/nm-remote-settings.c

index ba0aa47..80a274f 100644 (file)
@@ -493,7 +493,7 @@ connection_inited (GObject *source, GAsyncResult *result, gpointer user_data)
                        local = g_error_new (NM_REMOTE_SETTINGS_ERROR,
                                             NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE,
                                             "Connection not visible or not available: %s",
-                                            error ? error->message : "(unknown)");
+                                            error->message);
                        add_connection_info_complete (self, addinfo, local);
                        g_error_free (local);
                }