diff options
Diffstat (limited to 'pkg/sentry/socket/unix/transport/connectionless.go')
-rw-r--r-- | pkg/sentry/socket/unix/transport/connectionless.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/socket/unix/transport/connectionless.go b/pkg/sentry/socket/unix/transport/connectionless.go index cd4633106..376e4abb2 100644 --- a/pkg/sentry/socket/unix/transport/connectionless.go +++ b/pkg/sentry/socket/unix/transport/connectionless.go @@ -82,9 +82,13 @@ func (e *connectionlessEndpoint) UnidirectionalConnect() (ConnectedEndpoint, *tc if r == nil { return nil, tcpip.ErrConnectionRefused } + q := r.(*queueReceiver).readQueue + if !q.TryIncRef() { + return nil, tcpip.ErrConnectionRefused + } return &connectedEndpoint{ endpoint: e, - writeQueue: r.(*queueReceiver).readQueue, + writeQueue: q, }, nil } |