libtracefs: Don't leak socket file descriptor in open_vsock()

Close the socket file descriptor if connect() fails.

Fixes a RESSOURCE_LEAK error (CWE-772)

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

Fixes: 5ea41283fa071 ("libtracefs: Add tracefs_find_cid_pid() API")
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed