Skip to content

Commit

Permalink
Fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jontified committed Jan 3, 2024
1 parent 5114ae4 commit 3247076
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions talpid-core/src/firewall/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl Firewall {
dns_servers.iter().cloned().map(widestring_ip).collect();
let dns_servers: Vec<*const u16> = dns_servers.iter().map(|ip| ip.as_ptr()).collect();

unsafe {
let result = unsafe {
WinFw_ApplyPolicyConnected(
winfw_settings,
&winfw_relay,
Expand All @@ -304,11 +304,12 @@ impl Firewall {
)
.into_result()
.map_err(Error::ApplyingConnectedPolicy)
}
};

// SAFETY: `relay_client_wstrs` holds memory pointed to by pointers used in C++ and must
// not be dropped until after `WinFw_ApplyPolicyConnected` has returned.
drop(relay_client_wstrs);
result
}

fn set_blocked_state(
Expand Down

0 comments on commit 3247076

Please sign in to comment.