From 6db85c1dd26bea2b9018d9ac38dd96509018823f Mon Sep 17 00:00:00 2001 From: Scoopta Date: Sat, 9 May 2020 13:20:19 -0700 Subject: [PATCH] The GError is now always freed if it's non-null --- src/wofi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wofi.c b/src/wofi.c index a510008..fbf0493 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -1256,8 +1256,10 @@ static gboolean focus_entry(GtkWidget* widget, GdkEvent* event, gpointer data) { if(widget == entry && dbus != NULL) { GError* err = NULL; g_dbus_proxy_call_sync(dbus, "SetVisible", g_variant_new("(b)", event->focus_change.in), G_DBUS_CALL_FLAGS_NONE, 2000, NULL, &err); - if(err != NULL && err->code != G_DBUS_ERROR_SERVICE_UNKNOWN) { - fprintf(stderr, "Error while changing OSK state %s\n", err->message); + if(err != NULL) { + if(err->code != G_DBUS_ERROR_SERVICE_UNKNOWN) { + fprintf(stderr, "Error while changing OSK state %s\n", err->message); + } g_error_free(err); } }