Received: from eggs.gnu.org ([2001:4830:134:3::10]:46366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQne-0008Ne-Dr for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:54:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPQnd-0007Td-G9 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:54:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQnd-0007TS-AT for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:54:45 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D65FEC049E16 for ; Tue, 19 Jul 2016 08:54:44 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Tue, 19 Jul 2016 12:53:58 +0400 Message-Id: <20160719085432.4572-4-marcandre.lureau@redhat.com> In-Reply-To: <20160719085432.4572-1-marcandre.lureau@redhat.com> References: <20160719085432.4572-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 03/37] qga: free the whole blacklist List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Free the list, not just the elements. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qga/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/qga/main.c b/qga/main.c index 4c3b2c7..bb48214 100644 --- a/qga/main.c +++ b/qga/main.c @@ -1175,6 +1175,7 @@ static void config_free(GAConfig *config) #ifdef CONFIG_FSFREEZE g_free(config->fsfreeze_hook); #endif + g_list_free_full(config->blacklist, g_free); g_free(config); } =20 @@ -1310,11 +1311,6 @@ static int run_agent(GAState *s, GAConfig *config) return EXIT_SUCCESS; } =20 -static void free_blacklist_entry(gpointer entry, gpointer unused) -{ - g_free(entry); -} - int main(int argc, char **argv) { int ret =3D EXIT_SUCCESS; @@ -1379,7 +1375,6 @@ end: if (s->channel) { ga_channel_free(s->channel); } - g_list_foreach(config->blacklist, free_blacklist_entry, NULL); g_free(s->pstate_filepath); g_free(s->state_filepath_isfrozen); =20 --=20 2.9.0