Skip to content

Commit efec36d

Browse files
committed
Fix new compiler lints (explicit drop for Boxes)
1 parent ae67959 commit efec36d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

openssl/src/ssl/bio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ unsafe extern "C" fn destroy<S>(bio: *mut BIO) -> c_int {
183183

184184
let data = BIO_get_data(bio);
185185
assert!(!data.is_null());
186-
Box::<StreamState<S>>::from_raw(data as *mut _);
186+
drop(Box::<StreamState<S>>::from_raw(data as *mut _));
187187
BIO_set_data(bio, ptr::null_mut());
188188
BIO_set_init(bio, 0);
189189
1
@@ -257,7 +257,7 @@ cfg_if! {
257257
impl Drop for BIO_METHOD {
258258
fn drop(&mut self) {
259259
unsafe {
260-
Box::<ffi::BIO_METHOD>::from_raw(self.0);
260+
drop(Box::<ffi::BIO_METHOD>::from_raw(self.0));
261261
}
262262
}
263263
}

openssl/src/ssl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ unsafe extern "C" fn free_data_box<T>(
558558
_argp: *mut c_void,
559559
) {
560560
if !ptr.is_null() {
561-
Box::<T>::from_raw(ptr as *mut T);
561+
drop(Box::<T>::from_raw(ptr as *mut T));
562562
}
563563
}
564564

0 commit comments

Comments
 (0)