From 9ec9d8e27ba8ccfd5db03dfc93ddfd3acbf8e79d Mon Sep 17 00:00:00 2001 From: xiaobo tian Date: Wed, 7 Aug 2024 11:41:10 +0800 Subject: [PATCH] fix(net) losing the raw file descriptor may leak resources Signed-off-by: xiaobo tian --- crates/shadowsocks/src/net/sys/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/shadowsocks/src/net/sys/mod.rs b/crates/shadowsocks/src/net/sys/mod.rs index a12858ecbc78..b36033a79781 100644 --- a/crates/shadowsocks/src/net/sys/mod.rs +++ b/crates/shadowsocks/src/net/sys/mod.rs @@ -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 }