Skip to content

Commit

Permalink
fix(net) losing the raw file descriptor may leak resources
Browse files Browse the repository at this point in the history
Signed-off-by: xiaobo tian <[email protected]>
  • Loading branch information
peterwillcn authored and zonyitoo committed Aug 7, 2024
1 parent 29fc232 commit 9ec9d8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/shadowsocks/src/net/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where

let sock = unsafe { Socket::from_raw_fd(fd) };
let result = socket_bind_dual_stack_inner(&sock, addr, ipv6_only);
sock.into_raw_fd();
let _ = sock.into_raw_fd();

result
}
Expand Down

0 comments on commit 9ec9d8e

Please sign in to comment.