trace-cmd record: Close socket fd before retrying to connect

In create_record(), if the client whose connection it just accepted
doesn't match, it tries to call get another connection without
releasing the socket file descriptor.

Close the file descriptor before retrying to connect.

Fixes a RESOURCE_LEAK error (CWE-772)

Link: https://lore.kernel.org/linux-trace-devel/[email protected]

Signed-off-by: Jerome Marchand <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 file changed