[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 03/37] qga: free the whole blacklist
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v2 03/37] qga: free the whole blacklist |
Date: |
Thu, 28 Jul 2016 18:37:34 +0400 |
From: Marc-André Lureau <address@hidden>
Free the list, not just the elements.
Signed-off-by: Marc-André Lureau <address@hidden>
---
qga/main.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/qga/main.c b/qga/main.c
index 4c3b2c7..67be90b 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1175,6 +1175,8 @@ static void config_free(GAConfig *config)
#ifdef CONFIG_FSFREEZE
g_free(config->fsfreeze_hook);
#endif
+ g_list_foreach(config->blacklist, (GFunc)g_free, NULL);
+ g_list_free(config->blacklist);
g_free(config);
}
@@ -1310,11 +1312,6 @@ static int run_agent(GAState *s, GAConfig *config)
return EXIT_SUCCESS;
}
-static void free_blacklist_entry(gpointer entry, gpointer unused)
-{
- g_free(entry);
-}
-
int main(int argc, char **argv)
{
int ret = EXIT_SUCCESS;
@@ -1379,7 +1376,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);
--
2.9.0
- [Qemu-devel] [PATCH v2 00/37] Various memory leak fixes, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 04/37] qga: free remaining leaking state, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 06/37] tests: fix test-vmstate leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 05/37] tests: fix test-cutils leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 07/37] tests: fix test-iov leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 08/37] qdist: fix entries memory leak, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 09/37] tests: fix check-qom-interface leaks, marcandre . lureau, 2016/07/28