From 5eca9a8b3defab802715ca8367739ff3955fba7d Mon Sep 17 00:00:00 2001 From: Will Toohey Date: Tue, 28 Nov 2023 10:34:38 +1000 Subject: [PATCH] Fix crash in release mode for mdns example control_buffer was going out of scope Closes #14 --- src/win.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win.rs b/src/win.rs index f404fd2..f213234 100644 --- a/src/win.rs +++ b/src/win.rs @@ -373,8 +373,8 @@ impl MulticastSocket { len: buf.len() as _, }; + let mut control_buffer = [0; CONTROL_PKTINFO_BUFFER_SIZE]; let control = if let Some(pkt_info) = pkt_info { - let mut control_buffer = [0; CONTROL_PKTINFO_BUFFER_SIZE]; let hdr = CMSGHDR { cmsg_len: CONTROL_PKTINFO_BUFFER_SIZE, cmsg_level: IPPROTO_IP,