Skip to content

Commit 0cc2983

Browse files
committed
Fix possible double free with platform recognizer in Rust API
1 parent e0a4bb0 commit 0cc2983

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/src/custom_binary_view.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ pub trait BinaryViewTypeExt: BinaryViewTypeBase {
280280
let bv = unsafe { BinaryView::from_raw(bv).to_owned() };
281281
let metadata = unsafe { Metadata::from_raw(metadata).to_owned() };
282282
match (context.recognizer)(&bv, &metadata) {
283-
Some(plat) => plat.handle,
283+
Some(plat) => unsafe { Ref::into_raw(plat).handle },
284284
None => std::ptr::null_mut(),
285285
}
286286
}

0 commit comments

Comments
 (0)