trace-cmd msg: Prevent a memory leak in get_trace_req_args()

In get_trace_req_args() vagrs is not freed when the function exits
without an error. This could be of course be fixed by freeing vagrs
before exit, but actually I don't see the point of the buffer at all
since it just use to copy the content of buf and then read to fill
args. Why not just read from buf to begin with?

Remove vagrs and use buf directly.

Fixes a RESOURCE_LEAK error (CWE-772)

Link: https://lore.kernel.org/linux-trace-devel/20240605134054.2626953-3-jmarchan@redhat.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed