mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix another socket Dirent refcount.
PiperOrigin-RevId: 196893452 Change-Id: I5ea0f851fcabc5eac5859e61f15213323d996337
This commit is contained in:
committed by
Shentubot
parent
3131a6b131
commit
8e1deb2ab8
@@ -71,6 +71,7 @@ func newSocketFile(ctx context.Context, stack *Stack, family int, skType int, pr
|
||||
stack.notifier.AddFD(fd, &wq)
|
||||
|
||||
dirent := socket.NewDirent(ctx, socketDevice)
|
||||
defer dirent.DecRef()
|
||||
return fs.NewFile(ctx, dirent, fs.FileFlags{Read: true, Write: true}, &socketOperations{
|
||||
wq: &wq,
|
||||
fd: fd,
|
||||
@@ -274,6 +275,7 @@ func (s *socketOperations) Accept(t *kernel.Task, peerRequested bool, flags int,
|
||||
s.notifier.AddFD(payload.Fd, &wq)
|
||||
|
||||
dirent := socket.NewDirent(t, socketDevice)
|
||||
defer dirent.DecRef()
|
||||
file := fs.NewFile(t, dirent, fs.FileFlags{Read: true, Write: true, NonBlocking: flags&linux.SOCK_NONBLOCK != 0}, &socketOperations{
|
||||
wq: &wq,
|
||||
fd: payload.Fd,
|
||||
|
||||
Reference in New Issue
Block a user