libtracefs: Prevent memory leak in tracefs_dynevent_get_all()

Free events in the error path of tracefs_dynevent_get_all().

Fixes a RESSOURCE_LEAK error (CWE-772)

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

Fixes: b04f18b005c6b ("libtracefs: New APIs for dynamic events")
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed