Skip to content

Commit

Permalink
Fix warning of unused Box::from_raw() return value. (cloudflare#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
behrat authored Sep 27, 2022
1 parent 6d4fb2e commit 897b291
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions boringtun/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub extern "C" fn x25519_key_to_hex(key: x25519_key) -> *const c_char {
/// Frees memory of the string given by `x25519_key_to_hex` or `x25519_key_to_base64`
#[no_mangle]
pub unsafe extern "C" fn x25519_key_to_str_free(stringified_key: *mut c_char) {
let _ = CString::from_raw(stringified_key);
drop(CString::from_raw(stringified_key));
}

/// Check if the input C-string represents a valid base64 encoded x25519 key.
Expand Down Expand Up @@ -322,7 +322,7 @@ pub unsafe extern "C" fn new_tunnel(
/// Drops the Tunn object
#[no_mangle]
pub unsafe extern "C" fn tunnel_free(tunnel: *mut Mutex<Tunn>) {
Box::from_raw(tunnel);
drop(Box::from_raw(tunnel));
}

/// Write an IP packet from the tunnel interface.
Expand Down

0 comments on commit 897b291

Please sign in to comment.