Message ID | 20220922002348.3302169-3-rostedt@goodmis.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 43ffa27adf1af4273b90802b8cec2b3746cc5858 |
Headers | show |
Series | trace-cmd: A few fixes | expand |
diff --git a/tracecmd/trace-vsock.c b/tracecmd/trace-vsock.c index 3bad9efad39a..baa310f7586b 100644 --- a/tracecmd/trace-vsock.c +++ b/tracecmd/trace-vsock.c @@ -19,8 +19,10 @@ int __hidden trace_vsock_open(unsigned int cid, unsigned int port) if (sd < 0) return -errno; - if (connect(sd, (struct sockaddr *)&addr, sizeof(addr))) + if (connect(sd, (struct sockaddr *)&addr, sizeof(addr))) { + close(sd); return -errno; + } return sd; }