contrib/plugins: fix imatch
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 27 Feb 2024 14:43:31 +0000 (14:43 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 28 Feb 2024 09:11:42 +0000 (09:11 +0000)
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>

contrib/plugins/execlog.c

index 82dc2f584e20d204716330cbfc1ecc57d4239206..f262e5555eb85ddd7b0892627fc4a0dac34cb3aa 100644 (file)
@@ -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)