trace-cmd record: Check allocation of creating path variable

The reset->path = strdup(file) should check if the allocation fails.

Link: https://lore.kernel.org/20261021162008.3696574a@gandalf.local.home
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217126
Reported-by: Markus Elfring <Markus.Elfring@web.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 1ee3eff..3a6e475 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -262,6 +262,8 @@
 	if (!reset)
 		die("Failed to allocate reset");
 	reset->path = strdup(file);
+	if (!reset->path)
+		die("Failed to allocate path");
 
 	reset->next = reset_triggers;
 	reset_triggers = reset;