diff --git a/src/header/ifaddrs/mod.rs b/src/header/ifaddrs/mod.rs index 3df9df0244..5e59e8b9ad 100644 --- a/src/header/ifaddrs/mod.rs +++ b/src/header/ifaddrs/mod.rs @@ -1,5 +1,8 @@ //! `ifaddrs.h` implementation +// TODO: set this for entire crate when possible +#![deny(unsafe_op_in_unsafe_fn)] + use core::ptr; use crate::{ @@ -27,8 +30,8 @@ pub struct ifaddrs { #[unsafe(no_mangle)] pub unsafe extern "C" fn freeifaddrs(mut ifa: *mut ifaddrs) { while !ifa.is_null() { - let next = (*ifa).ifa_next; - stdlib::free(ifa.cast()); + let next = unsafe { (*ifa).ifa_next }; + unsafe { stdlib::free(ifa.cast()) }; ifa = next; } }