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/delegates/pixbufdelegate.cpp b/src/delegates/pixbufdelegate.cpp
index fbfc49e..0d0f07a 100644
--- a/src/delegates/pixbufdelegate.cpp
+++ b/src/delegates/pixbufdelegate.cpp
@@ -137,8 +137,7 @@
 
     if (!pixbuf) {
         // g_debug("failed decoding person photo using base64: %s", error->message);
-        g_error_free(error);
-        error = NULL;
+        g_clear_error(&error);
 
         /* failed with base64, try hex */
         QByteArray baHex = QByteArray::fromHex(data);
@@ -152,8 +151,7 @@
 
         if (!pixbuf) {
             // g_debug("failed decoding person photo using hex (ASCII): %s", error->message);
-            g_error_free(error);
-            error = NULL;
+            g_clear_error(&error);
         }
     }