From caeff6f96835d96064d37f6fdee3ca4d96cc9979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 10 Jul 2019 17:20:45 +0300 Subject: [PATCH] threadshare/udpsrc: Use MaybeUninit instead of mem::zeroed() --- gst-plugin-threadshare/src/udpsrc.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst-plugin-threadshare/src/udpsrc.rs b/gst-plugin-threadshare/src/udpsrc.rs index 8d932623..0e2a38f1 100644 --- a/gst-plugin-threadshare/src/udpsrc.rs +++ b/gst-plugin-threadshare/src/udpsrc.rs @@ -133,13 +133,14 @@ unsafe fn dup_socket(socket: usize) -> usize { use winapi::um::processthreadsapi; use winapi::um::winsock2; - let mut proto_info = mem::zeroed(); + let mut proto_info = mem::MaybeUninit::uninit(); let ret = winsock2::WSADuplicateSocketA( socket, processthreadsapi::GetCurrentProcessId(), - &mut proto_info, + proto_info.as_mut_ptr(), ); assert_eq!(ret, 0); + let mut proto_info = prot_info.assume_init(); let socket = winsock2::WSASocketA( ws2def::AF_INET,