printers: Replace D-Bus unrefs with g_autoptr

This case could leak the GDBusConnection
This commit is contained in:
Robert Ancell 2019-11-21 22:06:40 +13:00 committed by Robert Ancell
parent 6b79e7ffa1
commit e256dd57c3

View file

@ -258,7 +258,7 @@ printer_rename (const gchar *old_name,
cups_dest_t *dests = NULL;
cups_dest_t *dest = NULL;
cups_job_t *jobs = NULL;
GDBusConnection *bus;
g_autoptr(GDBusConnection) bus = NULL;
const gchar *printer_location = NULL;
const gchar *printer_info = NULL;
const gchar *printer_uri = NULL;
@ -477,7 +477,6 @@ printer_rename (const gchar *old_name,
-1,
NULL,
&add_error);
g_object_unref (bus);
if (output)
{