From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVaQz-0001Vm-Fe for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVaQx-0001zs-At for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:24:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVaQx-0001zn-51 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:24:47 -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 B28EE8553D for ; Fri, 5 Aug 2016 08:24:46 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Fri, 5 Aug 2016 12:23:50 +0400 Message-Id: <20160805082421.21994-6-marcandre.lureau@redhat.com> In-Reply-To: <20160805082421.21994-1-marcandre.lureau@redhat.com> References: <20160805082421.21994-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 for-2.7 v4 05/36] qga: free remaining leaking state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, eblake@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- qga/guest-agent-command-state.c | 6 ++++++ qga/guest-agent-core.h | 1 + qga/main.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/qga/guest-agent-command-state.c b/qga/guest-agent-command-st= ate.c index 4de229c..e609d32 100644 --- a/qga/guest-agent-command-state.c +++ b/qga/guest-agent-command-state.c @@ -71,3 +71,9 @@ GACommandState *ga_command_state_new(void) cs->groups =3D NULL; return cs; } + +void ga_command_state_free(GACommandState *cs) +{ + g_slist_free_full(cs->groups, g_free); + g_free(cs); +} diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h index 0a49516..63e9d39 100644 --- a/qga/guest-agent-core.h +++ b/qga/guest-agent-core.h @@ -28,6 +28,7 @@ void ga_command_state_add(GACommandState *cs, void ga_command_state_init_all(GACommandState *cs); void ga_command_state_cleanup_all(GACommandState *cs); GACommandState *ga_command_state_new(void); +void ga_command_state_free(GACommandState *cs); bool ga_logging_enabled(GAState *s); void ga_disable_logging(GAState *s); void ga_enable_logging(GAState *s); diff --git a/qga/main.c b/qga/main.c index bb48214..0b9d04e 100644 --- a/qga/main.c +++ b/qga/main.c @@ -1371,6 +1371,8 @@ int main(int argc, char **argv) end: if (s->command_state) { ga_command_state_cleanup_all(s->command_state); + ga_command_state_free(s->command_state); + json_message_parser_destroy(&s->parser); } if (s->channel) { ga_channel_free(s->channel); @@ -1383,6 +1385,10 @@ end: } =20 config_free(config); + if (s->main_loop) { + g_main_loop_unref(s->main_loop); + } + g_free(s); =20 return ret; } --=20 2.9.0