Skip to content

Commit

Permalink
No, we shouldn't call mem::forget to free
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkisemils committed Sep 24, 2024
1 parent 38aeb2b commit 420e4b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mullvad-ios/src/encrypted_dns_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub unsafe extern "C" fn encrypted_dns_proxy_init() -> *mut EncryptedDnsProxySta
/// by `encrypted_dns_proxy_init`. This function is not thread safe.
#[no_mangle]
pub unsafe extern "C" fn encrytped_dns_proxy_free(ptr: *mut EncryptedDnsProxyState) {
mem::forget(unsafe { Box::from_raw(ptr) })
let _ = unsafe { Box::from_raw(ptr) };
}

/// # Safety
Expand Down

0 comments on commit 420e4b5

Please sign in to comment.