From 09e44b96ddbd7185bc061967f93b2cd59ee500ec Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 13 Apr 2018 11:21:59 +0200 Subject: [PATCH] policy: fix potential leak of subject in auto_activate_device() --- src/nm-policy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 9f845c1b0e..0d5f8c79cb 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1192,7 +1192,7 @@ auto_activate_device (NMPolicy *self, gs_free NMSettingsConnection **connections = NULL; guint i, len; gs_free_error GError *error = NULL; - NMAuthSubject *subject; + gs_unref_object NMAuthSubject *subject = NULL; NMActiveConnection *ac; nm_assert (NM_IS_POLICY (self)); @@ -1274,8 +1274,6 @@ auto_activate_device (NMPolicy *self, G_CALLBACK (pending_ac_state_changed), g_object_ref (self)); g_object_weak_ref (G_OBJECT (ac), (GWeakNotify) pending_ac_gone, self); } - - g_object_unref (subject); } static gboolean