From 137a9bdcc2ef77580d6ba695d2748496b75e2c27 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 15 Dec 2020 12:58:21 +0000 Subject: [PATCH] gdbusauth: Use g_clear_object() to simplify the code a little Signed-off-by: Philip Withnall --- gio/gdbusauth.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c index 14cc5d70e..8a076ce20 100644 --- a/gio/gdbusauth.c +++ b/gio/gdbusauth.c @@ -1348,12 +1348,9 @@ _g_dbus_auth_run_server (GDBusAuth *auth, "Not implemented (server)"); out: - if (mech != NULL) - g_object_unref (mech); - if (dis != NULL) - g_object_unref (dis); - if (dos != NULL) - g_object_unref (dos); + g_clear_object (&mech); + g_clear_object (&dis); + g_clear_object (&dos); /* ensure return value is FALSE if error is set */ if (error != NULL && *error != NULL)