qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 39/43] contrib/plugins: fix imatch


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 39/43] contrib/plugins: fix imatch
Date: Wed, 3 Jan 2024 18:47:17 +0100
User-agent: Mozilla Thunderbird

On 3/1/24 18:33, Alex Bennée wrote:
We can't directly save the ephemeral imatch from argv as that memory
will get recycled.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
  contrib/plugins/execlog.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
index 82dc2f584e2..f262e5555eb 100644
--- a/contrib/plugins/execlog.c
+++ b/contrib/plugins/execlog.c
@@ -199,7 +199,7 @@ static void parse_insn_match(char *match)

Could 'match' become const?

      if (!imatches) {
          imatches = g_ptr_array_new();
      }
-    g_ptr_array_add(imatches, match);
+    g_ptr_array_add(imatches, g_strdup(match));
  }
static void parse_vaddr_match(char *match)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]