gnome: use g_clear_error to free GError

This sets the GError to NULL after freeing it
which is useful in cases where the GError might
be re-used.

Refs #72309

Change-Id: If3c33235378bc080b497bed732570f17e8e6d3e9
diff --git a/src/ring_client.cpp b/src/ring_client.cpp
index c5530aa..8591d6e 100644
--- a/src/ring_client.cpp
+++ b/src/ring_client.cpp
@@ -279,7 +279,7 @@
     if (g_option_context_parse(context, &argc, &argv, &error) == FALSE) {
         g_print(_("%s\nRun '%s --help' to see a full list of available command line options.\n"),
                 error->message, argv[0]);
-        g_error_free(error);
+        g_clear_error(&error);
         g_option_context_free(context);
         return 1;
     }