From: Mahmoud Mandour <ma.mandourr@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Mahmoud Mandour" <ma.mandourr@gmail.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH 1/2] plugins/hotblocks: Properly freed the hash table values
Date: Wed, 21 Apr 2021 16:09:33 +0200 [thread overview]
Message-ID: <20210421140934.7561-2-ma.mandourr@gmail.com> (raw)
In-Reply-To: <20210421140934.7561-1-ma.mandourr@gmail.com>
Freed the values stored in the hash table ``hotblocks``
returned by ``g_hash_table_get_values()`` by freeing the sorted
list and destroyed the hash table afterward.
Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com>
---
contrib/plugins/hotblocks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c
index 4b08340143..64692c0670 100644
--- a/contrib/plugins/hotblocks.c
+++ b/contrib/plugins/hotblocks.c
@@ -68,10 +68,11 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
rec->insns, rec->exec_count);
}
- g_list_free(it);
+ g_list_free_full(it, g_free);
g_mutex_unlock(&lock);
}
+ g_hash_table_destroy(hotblocks);
qemu_plugin_outs(report->str);
}
--
2.25.1
next prev parent reply other threads:[~2021-04-21 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 14:09 [PATCH 0/2] plugins: Freeing allocated values in hash tables Mahmoud Mandour
2021-04-21 14:09 ` Mahmoud Mandour [this message]
2021-04-21 14:09 ` [PATCH 2/2] plugins/hotpages: Properly freed the hash table values Mahmoud Mandour
2021-04-26 16:53 ` [PATCH 0/2] plugins: Freeing allocated values in hash tables Alex Bennée
2021-04-26 16:54 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210421140934.7561-2-ma.mandourr@gmail.com \
--to=ma.mandourr@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).