trace-cmd record: Check allocation of creating path variable
PATCH 1/1 trace-cmd record: Check allocation of creating path variable
From: Steven Rostedt <[email protected]>
The reset->path = strdup(file) should check if the allocation fails.
Reported-by Markus Elfring <[email protected]>
Signed-off-by Steven Rostedt <[email protected]>
--- tracecmd/trace-record.c | 2 ++ 1 file changed, 2 insertions(+)
tracecmd/trace-record.c +2 -0
@@ -262,6 +262,8 @@ static void add_reset_trigger(const char *file)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;
Signature · 1 line
2.53.0