libtracefs: Close dir in the error path in tracefs_event_systems()

In tracefs_event_systems, we don't close dir if add_list_string()
fails. At this point, just breaking out of the loop fixes that.

Fixes a RESSOURCE_LEAK error (CWE-772)

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

Fixes: 056a177e1d686 ("libtracefs: Restructure how string lists work")
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed