main: Avoid two error variables in the same function

This also fixes a superfluous additional `NULL` assignment right
after declaring error and setting it to NULL.
This commit is contained in:
Guido Günther
2021-11-21 20:47:35 +01:00
parent 475761ec73
commit 28a48635b3

View File

@ -316,13 +316,10 @@ main (int argc, char **argv)
// if text-input is used, as it can bring the keyboard in and out
GDBusConnection *connection = NULL;
GError *error = NULL;
error = NULL;
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &err);
if (connection == NULL) {
g_printerr ("Can't connect to the bus: %s. "
"Visibility switching unavailable.", error->message);
g_error_free (error);
"Visibility switching unavailable.", err->message);
}
guint owner_id = 0;
DBusHandler *service = NULL;