diff mbox series

[PULL,25/29] contrib/plugins: fix imatch

Message ID 20240228115701.1416107-26-alex.bennee@linaro.org
State Accepted
Commit 9e096a76c78ac215e8d06cc9739ab9c181d85a2b
Headers show
Series [PULL,01/29] tests/tcg: update licenses to GPLv2 as intended | expand

Commit Message

Alex Bennée Feb. 28, 2024, 11:56 a.m. UTC
We can't directly save the ephemeral imatch from argv as that memory
will get recycled.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240227144335.1196131-26-alex.bennee@linaro.org>
diff mbox series

Patch

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)
     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)