libtracefs: Close dir in the error path in tracefs_system_events()
In tracefs_system_events(), 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-14-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