qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH] plugins/howvec: fix use-after-free
Date: Mon, 11 Mar 2024 10:04:56 +0400	[thread overview]
Message-ID: <20240311060456.218190-1-pierrick.bouvier@linaro.org> (raw)

reported by coverity scan
---
 contrib/plugins/howvec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 2d10c87e0fb..5be91f6fc5c 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -168,8 +168,8 @@ static void free_record(gpointer data)
 {
     InsnExecCount *rec = (InsnExecCount *) data;
     g_free(rec->insn);
-    g_free(rec);
     qemu_plugin_scoreboard_free(rec->count.score);
+    g_free(rec);
 }
 
 static void plugin_exit(qemu_plugin_id_t id, void *p)
-- 
2.39.2



             reply	other threads:[~2024-03-11  6:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11  6:04 Pierrick Bouvier [this message]
2024-03-11  8:31 ` [PATCH] plugins/howvec: fix use-after-free Philippe Mathieu-Daudé

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=20240311060456.218190-1-pierrick.bouvier@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --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).