Skip to content

Commit

Permalink
qga: free the whole blacklist
Browse files Browse the repository at this point in the history
Free the config blacklist list, not just the elements. Do it so in the
more appropriate function config_free().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
  • Loading branch information
elmarco committed Sep 8, 2016
1 parent 5c7e3e9 commit 2aa67a9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions qga/main.c
Expand Up @@ -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);
}

Expand Down Expand Up @@ -1310,11 +1311,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;
Expand Down Expand Up @@ -1379,7 +1375,6 @@ int main(int argc, char **argv)
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);

Expand Down

0 comments on commit 2aa67a9

Please sign in to comment.